Fix collapsible_if false positive with attributes

This commit is contained in:
Cameron Steffen 2021-02-08 11:00:30 -06:00
parent 1021327781
commit 39ba449c2a
5 changed files with 34 additions and 0 deletions

View file

@ -65,4 +65,13 @@ fn main() {
else {
println!("!")
}
if x == "hello" {
print!("Hello ");
} else {
#[cfg(not(roflol))]
if y == "world" {
println!("world!")
}
}
}

View file

@ -79,4 +79,13 @@ fn main() {
println!("!")
}
}
if x == "hello" {
print!("Hello ");
} else {
#[cfg(not(roflol))]
if y == "world" {
println!("world!")
}
}
}

View file

@ -138,4 +138,11 @@ fn main() {
// Fix #5962
if matches!(true, true) && matches!(true, true) {}
if true {
#[cfg(not(teehee))]
if true {
println!("Hello world!");
}
}
}

View file

@ -154,4 +154,11 @@ fn main() {
if matches!(true, true) {
if matches!(true, true) {}
}
if true {
#[cfg(not(teehee))]
if true {
println!("Hello world!");
}
}
}