Implement dummy expansions for builtin attributes

This commit is contained in:
Lukas Wirth 2021-06-09 18:02:31 +02:00
parent 5f592f4f58
commit ae8d74ab2c
10 changed files with 176 additions and 11 deletions

View file

@ -656,6 +656,32 @@ fn main() { let _ = crate::$0 }
);
}
#[test]
fn does_not_complete_non_fn_macros() {
check(
r#"
mod m {
#[rustc_builtin_macro]
pub macro Clone {}
}
fn f() {m::$0}
"#,
expect![[r#""#]],
);
check(
r#"
mod m {
#[rustc_builtin_macro]
pub macro bench {}
}
fn f() {m::$0}
"#,
expect![[r#""#]],
);
}
#[test]
fn completes_in_assoc_item_list() {
check(

View file

@ -481,14 +481,14 @@ impl S {
);
check(
r#"
mod m {
#[rustc_builtin_macro]
pub macro Clone {}
}
#[rustc_builtin_macro]
pub macro bench {}
fn f() {m::$0}
fn f() {$0}
"#,
expect![[r#""#]],
expect![[r#"
fn f() fn()
"#]],
);
}