mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Collect diagnostics in queries instead of nameres
This commit is contained in:
parent
89107d5469
commit
b21bf25a07
5 changed files with 194 additions and 116 deletions
|
@ -142,12 +142,18 @@ trait Bar {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn inactive_fields() {
|
||||
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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue