@@ -2,7 +2,6 @@ mod block;
22
33use base_db:: { fixture:: WithFixture , SourceDatabase } ;
44use expect_test:: { expect, Expect } ;
5- use hir_expand:: db:: ExpandDatabase ;
65
76use crate :: { test_db:: TestDB , ModuleDefId } ;
87
@@ -255,7 +254,6 @@ impl SsrError {
255254}
256255"## ,
257256 ) ;
258- println ! ( "{}" , db. dump_syntax_contexts( ) ) ;
259257
260258 assert_eq ! ( db. body_with_source_map( def. into( ) ) . 1 . diagnostics( ) , & [ ] ) ;
261259 expect ! [ [ r#"
@@ -288,3 +286,49 @@ impl SsrError {
288286 }"# ] ]
289287 . assert_eq ( & body. pretty_print ( & db, def) )
290288}
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