diff --git a/crates/ra_hir_expand/src/builtin_macro.rs b/crates/ra_hir_expand/src/builtin_macro.rs index 51d54331ee..a57e9285fb 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]