Skip to content

Commit 2e178b5

Browse files
committed
Fix test and add more comment
1 parent 36c7684 commit 2e178b5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/ra_hir_expand/src/builtin_macro.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ fn env_expand(
142142
_tt: &tt::Subtree,
143143
) -> Result<tt::Subtree, mbe::ExpandError> {
144144
// dummy implementation for type-checking purposes
145+
// we cannot use an empty string here, because for
146+
// `include!(concat!(env!("OUT_DIR"), "/foo.rs"))` will become
147+
// `include!("foo.rs"), which maybe infinite loop
145148
let expanded = quote! { "__RA_UNIMPLEMENTATED__" };
146149

147150
Ok(expanded)
@@ -394,7 +397,7 @@ mod tests {
394397
"#,
395398
);
396399

397-
assert_eq!(expanded, "\"\"");
400+
assert_eq!(expanded, "\"__RA_UNIMPLEMENTATED__\"");
398401
}
399402

400403
#[test]

0 commit comments

Comments
 (0)