@@ -2,7 +2,6 @@ mod block;
2
2
3
3
use base_db:: { fixture:: WithFixture , SourceDatabase } ;
4
4
use expect_test:: { expect, Expect } ;
5
- use hir_expand:: db:: ExpandDatabase ;
6
5
7
6
use crate :: { test_db:: TestDB , ModuleDefId } ;
8
7
@@ -255,7 +254,6 @@ impl SsrError {
255
254
}
256
255
"## ,
257
256
) ;
258
- println ! ( "{}" , db. dump_syntax_contexts( ) ) ;
259
257
260
258
assert_eq ! ( db. body_with_source_map( def. into( ) ) . 1 . diagnostics( ) , & [ ] ) ;
261
259
expect ! [ [ r#"
@@ -288,3 +286,49 @@ impl SsrError {
288
286
}"# ] ]
289
287
. assert_eq ( & body. pretty_print ( & db, def) )
290
288
}
289
+
290
+ #[ test]
291
+ fn regression_10300 ( ) {
292
+ let ( db, body, def) = lower (
293
+ r#"
294
+ //- minicore: concat, panic
295
+ mod private {
296
+ pub use core::concat;
297
+ }
298
+
299
+ macro_rules! m {
300
+ () => {
301
+ panic!(concat!($crate::private::concat!("cc")));
302
+ };
303
+ }
304
+
305
+ fn f() {
306
+ m!();
307
+ }
308
+ "# ,
309
+ ) ;
310
+
311
+ let ( _, source_map) = db. body_with_source_map ( def. into ( ) ) ;
312
+ assert_eq ! ( source_map. diagnostics( ) , & [ ] ) ;
313
+
314
+ for ( _, def_map) in body. blocks ( & db) {
315
+ assert_eq ! ( def_map. diagnostics( ) , & [ ] ) ;
316
+ }
317
+
318
+ expect ! [ [ r#"
319
+ fn f() {
320
+ $crate::panicking::panic_fmt(
321
+ builtin#lang(Arguments::new_v1_formatted)(
322
+ &[
323
+ "\"cc\"",
324
+ ],
325
+ &[],
326
+ &[],
327
+ unsafe {
328
+ builtin#lang(UnsafeArg::new)()
329
+ },
330
+ ),
331
+ );
332
+ }"# ] ]
333
+ . assert_eq ( & body. pretty_print ( & db, def) )
334
+ }
0 commit comments