Collect diagnostics in queries instead of nameres

This commit is contained in:
unexge 2022-09-21 23:05:30 +01:00
parent 89107d5469
commit b21bf25a07
5 changed files with 194 additions and 116 deletions

View file

@ -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 {