From 2e178b5475b156e1876e4e6971c0abd3bdf6c889 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Sat, 7 Mar 2020 13:02:54 +0800 Subject: Fix test and add more comment --- crates/ra_hir_expand/src/builtin_macro.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'crates') diff --git a/crates/ra_hir_expand/src/builtin_macro.rs b/crates/ra_hir_expand/src/builtin_macro.rs index 51d54331e..a57e9285f 100644 --- a/crates/ra_hir_expand/src/builtin_macro.rs +++ b/crates/ra_hir_expand/src/builtin_macro.rs @@ -142,6 +142,9 @@ fn env_expand( _tt: &tt::Subtree, ) -> Result { // dummy implementation for type-checking purposes + // we cannot use an empty string here, because for + // `include!(concat!(env!("OUT_DIR"), "/foo.rs"))` will become + // `include!("foo.rs"), which maybe infinite loop let expanded = quote! { "__RA_UNIMPLEMENTATED__" }; Ok(expanded) @@ -394,7 +397,7 @@ mod tests { "#, ); - assert_eq!(expanded, "\"\""); + assert_eq!(expanded, "\"__RA_UNIMPLEMENTATED__\""); } #[test] -- cgit v1.2.3