File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ fn env_expand(
142
142
_tt : & tt:: Subtree ,
143
143
) -> Result < tt:: Subtree , mbe:: ExpandError > {
144
144
// dummy implementation for type-checking purposes
145
- let expanded = quote ! { "" } ;
145
+ let expanded = quote ! { "__RA_UNIMPLEMENTATED__ " } ;
146
146
147
147
Ok ( expanded)
148
148
}
Original file line number Diff line number Diff line change @@ -483,6 +483,33 @@ fn bar() -> u32 {0}
483
483
assert_eq ! ( "u32" , type_at_pos( & db, pos) ) ;
484
484
}
485
485
486
+ #[ test]
487
+ fn infer_builtin_macros_include_concat_with_bad_env_should_failed ( ) {
488
+ let ( db, pos) = TestDB :: with_position (
489
+ r#"
490
+ //- /main.rs
491
+ #[rustc_builtin_macro]
492
+ macro_rules! include {() => {}}
493
+
494
+ #[rustc_builtin_macro]
495
+ macro_rules! concat {() => {}}
496
+
497
+ #[rustc_builtin_macro]
498
+ macro_rules! env {() => {}}
499
+
500
+ include!(concat!(env!("OUT_DIR"), "/foo.rs"));
501
+
502
+ fn main() {
503
+ bar()<|>;
504
+ }
505
+
506
+ //- /foo.rs
507
+ fn bar() -> u32 {0}
508
+ "# ,
509
+ ) ;
510
+ assert_eq ! ( "{unknown}" , type_at_pos( & db, pos) ) ;
511
+ }
512
+
486
513
#[ test]
487
514
fn infer_builtin_macros_concat_with_lazy ( ) {
488
515
assert_snapshot ! (
You can’t perform that action at this time.
0 commit comments