rust/tests/ui/collapsible_else_if.stderr

164 lines
3.4 KiB
Plaintext
Raw Normal View History

2020-01-07 06:06:23 +00:00
error: this `else { if .. }` block can be collapsed
--> $DIR/collapsible_else_if.rs:14:12
2020-01-07 06:06:23 +00:00
|
LL | } else {
| ____________^
LL | | if y == "world" {
LL | | println!("world!")
LL | | }
LL | | }
| |_____^
|
= note: `-D clippy::collapsible-else-if` implied by `-D warnings`
help: collapse nested if block
2020-01-07 06:06:23 +00:00
|
2021-08-11 14:21:33 +00:00
LL ~ } else if y == "world" {
LL + println!("world!")
LL + }
2020-01-07 06:06:23 +00:00
|
error: this `else { if .. }` block can be collapsed
--> $DIR/collapsible_else_if.rs:22:12
2020-01-07 06:06:23 +00:00
|
LL | } else {
| ____________^
LL | | if let Some(42) = Some(42) {
LL | | println!("world!")
LL | | }
LL | | }
| |_____^
|
help: collapse nested if block
2020-01-07 06:06:23 +00:00
|
2021-08-11 14:21:33 +00:00
LL ~ } else if let Some(42) = Some(42) {
LL + println!("world!")
LL + }
2020-01-07 06:06:23 +00:00
|
error: this `else { if .. }` block can be collapsed
--> $DIR/collapsible_else_if.rs:30:12
2020-01-07 06:06:23 +00:00
|
LL | } else {
| ____________^
LL | | if y == "world" {
LL | | println!("world")
LL | | }
... |
LL | | }
LL | | }
| |_____^
|
help: collapse nested if block
2020-01-07 06:06:23 +00:00
|
2021-08-11 14:21:33 +00:00
LL ~ } else if y == "world" {
LL + println!("world")
LL + }
LL + else {
LL + println!("!")
LL + }
2020-01-07 06:06:23 +00:00
|
error: this `else { if .. }` block can be collapsed
--> $DIR/collapsible_else_if.rs:41:12
2020-01-07 06:06:23 +00:00
|
LL | } else {
| ____________^
LL | | if let Some(42) = Some(42) {
LL | | println!("world")
LL | | }
... |
LL | | }
LL | | }
| |_____^
|
help: collapse nested if block
2020-01-07 06:06:23 +00:00
|
2021-08-11 14:21:33 +00:00
LL ~ } else if let Some(42) = Some(42) {
LL + println!("world")
LL + }
LL + else {
LL + println!("!")
LL + }
2020-01-07 06:06:23 +00:00
|
error: this `else { if .. }` block can be collapsed
--> $DIR/collapsible_else_if.rs:52:12
2020-01-07 06:06:23 +00:00
|
LL | } else {
| ____________^
LL | | if let Some(42) = Some(42) {
LL | | println!("world")
LL | | }
... |
LL | | }
LL | | }
| |_____^
|
help: collapse nested if block
2020-01-07 06:06:23 +00:00
|
2021-08-11 14:21:33 +00:00
LL ~ } else if let Some(42) = Some(42) {
LL + println!("world")
LL + }
LL + else {
LL + println!("!")
LL + }
2020-01-07 06:06:23 +00:00
|
error: this `else { if .. }` block can be collapsed
--> $DIR/collapsible_else_if.rs:63:12
2020-01-07 06:06:23 +00:00
|
LL | } else {
| ____________^
LL | | if x == "hello" {
LL | | println!("world")
LL | | }
... |
LL | | }
LL | | }
| |_____^
|
help: collapse nested if block
2020-01-07 06:06:23 +00:00
|
2021-08-11 14:21:33 +00:00
LL ~ } else if x == "hello" {
LL + println!("world")
LL + }
LL + else {
LL + println!("!")
LL + }
2020-01-07 06:06:23 +00:00
|
error: this `else { if .. }` block can be collapsed
--> $DIR/collapsible_else_if.rs:74:12
2020-01-07 06:06:23 +00:00
|
LL | } else {
| ____________^
LL | | if let Some(42) = Some(42) {
LL | | println!("world")
LL | | }
... |
LL | | }
LL | | }
| |_____^
|
help: collapse nested if block
2020-01-07 06:06:23 +00:00
|
2021-08-11 14:21:33 +00:00
LL ~ } else if let Some(42) = Some(42) {
LL + println!("world")
LL + }
LL + else {
LL + println!("!")
LL + }
2020-01-07 06:06:23 +00:00
|
error: this `else { if .. }` block can be collapsed
--> $DIR/collapsible_else_if.rs:97:10
|
LL | }else{
| __________^
LL | | if false {}
LL | | }
| |_____^ help: collapse nested if block: `if false {}`
error: aborting due to 8 previous errors
2020-01-07 06:06:23 +00:00