mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
⬆️ rust-analyzer
This commit is contained in:
parent
3a57388d13
commit
4f55ebbd4f
122 changed files with 2885 additions and 1093 deletions
|
@ -137,6 +137,37 @@ trait Bar {
|
|||
|
||||
#[cfg_attr(not(never), inline, cfg(no))] fn h() {}
|
||||
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ weak: code is inactive due to #[cfg] directives: no is disabled
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn inactive_fields_and_variants() {
|
||||
check(
|
||||
r#"
|
||||
enum Foo {
|
||||
#[cfg(a)] Bar,
|
||||
//^^^^^^^^^^^^^ weak: code is inactive due to #[cfg] directives: a is disabled
|
||||
Baz {
|
||||
#[cfg(a)] baz: String,
|
||||
//^^^^^^^^^^^^^^^^^^^^^ weak: code is inactive due to #[cfg] directives: a is disabled
|
||||
},
|
||||
Qux(#[cfg(a)] String),
|
||||
//^^^^^^^^^^^^^^^^ weak: code is inactive due to #[cfg] directives: a is disabled
|
||||
}
|
||||
|
||||
struct Baz {
|
||||
#[cfg(a)] baz: String,
|
||||
//^^^^^^^^^^^^^^^^^^^^^ weak: code is inactive due to #[cfg] directives: a is disabled
|
||||
}
|
||||
|
||||
struct Qux(#[cfg(a)] String);
|
||||
//^^^^^^^^^^^^^^^^ weak: code is inactive due to #[cfg] directives: a is disabled
|
||||
|
||||
union FooBar {
|
||||
#[cfg(a)] baz: u32,
|
||||
//^^^^^^^^^^^^^^^^^^ weak: code is inactive due to #[cfg] directives: a is disabled
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue