rust/tests/ui/collapsible_if.stderr
bjorn3 ff796b6d70 Rename collapsable_if fix suggestion to "collapse nested if block"
The name "try" is confusing when shown as quick fix by rust-analyzer
2020-07-13 17:54:57 +02:00

123 lines
2.9 KiB
Plaintext

error: this `if` statement can be collapsed
--> $DIR/collapsible_if.rs:9:5
|
LL | / if x == "hello" {
LL | | if y == "world" {
LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
|
= note: `-D clippy::collapsible-if` implied by `-D warnings`
help: collapse nested if block
|
LL | if x == "hello" && y == "world" {
LL | println!("Hello world!");
LL | }
|
error: this `if` statement can be collapsed
--> $DIR/collapsible_if.rs:15:5
|
LL | / if x == "hello" || x == "world" {
LL | | if y == "world" || y == "hello" {
LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
|
help: collapse nested if block
|
LL | if (x == "hello" || x == "world") && (y == "world" || y == "hello") {
LL | println!("Hello world!");
LL | }
|
error: this `if` statement can be collapsed
--> $DIR/collapsible_if.rs:21:5
|
LL | / if x == "hello" && x == "world" {
LL | | if y == "world" || y == "hello" {
LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
|
help: collapse nested if block
|
LL | if x == "hello" && x == "world" && (y == "world" || y == "hello") {
LL | println!("Hello world!");
LL | }
|
error: this `if` statement can be collapsed
--> $DIR/collapsible_if.rs:27:5
|
LL | / if x == "hello" || x == "world" {
LL | | if y == "world" && y == "hello" {
LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
|
help: collapse nested if block
|
LL | if (x == "hello" || x == "world") && y == "world" && y == "hello" {
LL | println!("Hello world!");
LL | }
|
error: this `if` statement can be collapsed
--> $DIR/collapsible_if.rs:33:5
|
LL | / if x == "hello" && x == "world" {
LL | | if y == "world" && y == "hello" {
LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
|
help: collapse nested if block
|
LL | if x == "hello" && x == "world" && y == "world" && y == "hello" {
LL | println!("Hello world!");
LL | }
|
error: this `if` statement can be collapsed
--> $DIR/collapsible_if.rs:39:5
|
LL | / if 42 == 1337 {
LL | | if 'a' != 'A' {
LL | | println!("world!")
LL | | }
LL | | }
| |_____^
|
help: collapse nested if block
|
LL | if 42 == 1337 && 'a' != 'A' {
LL | println!("world!")
LL | }
|
error: this `if` statement can be collapsed
--> $DIR/collapsible_if.rs:95:5
|
LL | / if x == "hello" {
LL | | if y == "world" { // Collapsible
LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
|
help: collapse nested if block
|
LL | if x == "hello" && y == "world" { // Collapsible
LL | println!("Hello world!");
LL | }
|
error: aborting due to 7 previous errors