mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Prevent include! macro include itself
This commit is contained in:
parent
919747c323
commit
18f88ad10b
2 changed files with 24 additions and 1 deletions
|
@ -510,6 +510,24 @@ fn bar() -> u32 {0}
|
|||
assert_eq!("{unknown}", type_at_pos(&db, pos));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn infer_builtin_macros_include_itself_should_failed() {
|
||||
let (db, pos) = TestDB::with_position(
|
||||
r#"
|
||||
//- /main.rs
|
||||
#[rustc_builtin_macro]
|
||||
macro_rules! include {() => {}}
|
||||
|
||||
include!("main.rs");
|
||||
|
||||
fn main() {
|
||||
0<|>
|
||||
}
|
||||
"#,
|
||||
);
|
||||
assert_eq!("i32", type_at_pos(&db, pos));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn infer_builtin_macros_concat_with_lazy() {
|
||||
assert_snapshot!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue