rust/tests/ui/collapsible_if.stderr

123 lines
2.7 KiB
Plaintext
Raw Normal View History

error: this if statement can be collapsed
2019-01-13 04:44:45 -06:00
--> $DIR/collapsible_if.rs:9:5
|
2018-12-27 09:57:55 -06:00
LL | / if x == "hello" {
LL | | if y == "world" {
LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
|
= note: `-D clippy::collapsible-if` implied by `-D warnings`
help: try
2017-07-10 08:29:29 -05:00
|
2018-12-27 09:57:55 -06:00
LL | if x == "hello" && y == "world" {
LL | println!("Hello world!");
LL | }
2017-07-10 08:29:29 -05:00
|
error: this if statement can be collapsed
2019-01-13 04:44:45 -06:00
--> $DIR/collapsible_if.rs:15:5
|
2018-12-27 09:57:55 -06:00
LL | / if x == "hello" || x == "world" {
LL | | if y == "world" || y == "hello" {
LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
2019-10-26 14:53:42 -05:00
|
help: try
2017-07-10 08:29:29 -05:00
|
2018-12-27 09:57:55 -06:00
LL | if (x == "hello" || x == "world") && (y == "world" || y == "hello") {
LL | println!("Hello world!");
LL | }
2017-07-10 08:29:29 -05:00
|
error: this if statement can be collapsed
2019-01-13 04:44:45 -06:00
--> $DIR/collapsible_if.rs:21:5
|
2018-12-27 09:57:55 -06:00
LL | / if x == "hello" && x == "world" {
LL | | if y == "world" || y == "hello" {
LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
2019-10-26 14:53:42 -05:00
|
help: try
2017-07-10 08:29:29 -05:00
|
2018-12-27 09:57:55 -06:00
LL | if x == "hello" && x == "world" && (y == "world" || y == "hello") {
LL | println!("Hello world!");
LL | }
2017-07-10 08:29:29 -05:00
|
error: this if statement can be collapsed
2019-01-13 04:44:45 -06:00
--> $DIR/collapsible_if.rs:27:5
|
2018-12-27 09:57:55 -06:00
LL | / if x == "hello" || x == "world" {
LL | | if y == "world" && y == "hello" {
LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
2019-10-26 14:53:42 -05:00
|
help: try
2017-07-10 08:29:29 -05:00
|
2018-12-27 09:57:55 -06:00
LL | if (x == "hello" || x == "world") && y == "world" && y == "hello" {
LL | println!("Hello world!");
LL | }
2017-07-10 08:29:29 -05:00
|
error: this if statement can be collapsed
2019-01-13 04:44:45 -06:00
--> $DIR/collapsible_if.rs:33:5
|
2018-12-27 09:57:55 -06:00
LL | / if x == "hello" && x == "world" {
LL | | if y == "world" && y == "hello" {
LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
2019-10-26 14:53:42 -05:00
|
help: try
2017-07-10 08:29:29 -05:00
|
2018-12-27 09:57:55 -06:00
LL | if x == "hello" && x == "world" && y == "world" && y == "hello" {
LL | println!("Hello world!");
LL | }
2017-07-10 08:29:29 -05:00
|
error: this if statement can be collapsed
2019-01-13 04:44:45 -06:00
--> $DIR/collapsible_if.rs:39:5
|
2018-12-27 09:57:55 -06:00
LL | / if 42 == 1337 {
LL | | if 'a' != 'A' {
LL | | println!("world!")
LL | | }
LL | | }
| |_____^
2019-10-26 14:53:42 -05:00
|
help: try
2017-07-10 08:29:29 -05:00
|
2018-12-27 09:57:55 -06:00
LL | if 42 == 1337 && 'a' != 'A' {
LL | println!("world!")
LL | }
2017-07-10 08:29:29 -05:00
|
2018-10-16 15:20:27 -05:00
error: this if statement can be collapsed
2020-01-07 00:06:23 -06:00
--> $DIR/collapsible_if.rs:95:5
2018-12-27 09:57:55 -06:00
|
LL | / if x == "hello" {
LL | | if y == "world" { // Collapsible
LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
2019-10-26 14:53:42 -05:00
|
2018-10-16 15:20:27 -05:00
help: try
2018-12-27 09:57:55 -06:00
|
LL | if x == "hello" && y == "world" { // Collapsible
LL | println!("Hello world!");
LL | }
|
2018-10-16 15:20:27 -05:00
2020-01-07 00:06:23 -06:00
error: aborting due to 7 previous errors
2018-01-16 10:06:27 -06:00