Fix cfg_attr invalidating derive identifier IDE functionality

This commit is contained in:
Lukas Wirth 2022-01-30 22:46:05 +01:00
parent cc04cfc982
commit ddf7b70a0f
3 changed files with 14 additions and 15 deletions

View file

@ -1364,10 +1364,21 @@ impl Twait for Stwuct {
fn goto_def_derive_input() {
check(
r#"
//- minicore:derive
#[rustc_builtin_macro]
pub macro Copy {}
// ^^^^
#[derive(Copy$0)]
struct Foo;
"#,
);
check(
r#"
//- minicore:derive
#[rustc_builtin_macro]
pub macro Copy {}
// ^^^^
#[cfg_attr(feature = "false", derive)]
#[derive(Copy$0)]
struct Foo;
"#,