rust-clippy/tests/ui/if_same_then_else2.stderr

126 lines
2.7 KiB
Text
Raw Normal View History

2020-01-19 06:04:41 +00:00
error: this `if` has identical blocks
2020-04-06 22:46:40 +00:00
--> $DIR/if_same_then_else2.rs:19:12
2020-01-19 06:04:41 +00:00
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | for _ in &[42] {
LL | | let foo: &Option<_> = &Some::<u8>(42);
... |
LL | | }
LL | | }
| |_____^
|
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
note: same as this
2020-04-06 22:46:40 +00:00
--> $DIR/if_same_then_else2.rs:10:13
2020-01-19 06:04:41 +00:00
|
LL | if true {
| _____________^
LL | | for _ in &[42] {
LL | | let foo: &Option<_> = &Some::<u8>(42);
LL | | if true {
... |
LL | | }
LL | | } else {
| |_____^
error: this `if` has identical blocks
2020-04-06 22:46:40 +00:00
--> $DIR/if_same_then_else2.rs:33:12
2020-01-19 06:04:41 +00:00
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | if let Some(a) = Some(42) {}
LL | | }
| |_____^
|
note: same as this
2020-04-06 22:46:40 +00:00
--> $DIR/if_same_then_else2.rs:31:13
2020-01-19 06:04:41 +00:00
|
LL | if true {
| _____________^
LL | | if let Some(a) = Some(42) {}
LL | | } else {
| |_____^
error: this `if` has identical blocks
2020-04-06 22:46:40 +00:00
--> $DIR/if_same_then_else2.rs:40:12
2020-01-19 06:04:41 +00:00
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | if let (1, .., 3) = (1, 2, 3) {}
LL | | }
| |_____^
|
note: same as this
2020-04-06 22:46:40 +00:00
--> $DIR/if_same_then_else2.rs:38:13
2020-01-19 06:04:41 +00:00
|
LL | if true {
| _____________^
LL | | if let (1, .., 3) = (1, 2, 3) {}
LL | | } else {
| |_____^
error: this `if` has identical blocks
2020-04-06 22:46:40 +00:00
--> $DIR/if_same_then_else2.rs:90:12
2020-01-19 06:04:41 +00:00
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | f32::NAN
2020-01-19 06:04:41 +00:00
LL | | };
| |_____^
|
note: same as this
2020-04-06 22:46:40 +00:00
--> $DIR/if_same_then_else2.rs:88:21
2020-01-19 06:04:41 +00:00
|
LL | let _ = if true {
| _____________________^
LL | | f32::NAN
2020-01-19 06:04:41 +00:00
LL | | } else {
| |_____^
error: this `if` has identical blocks
2020-04-06 22:46:40 +00:00
--> $DIR/if_same_then_else2.rs:97:12
2020-01-19 06:04:41 +00:00
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | Ok("foo")?;
LL | | }
| |_____^
|
note: same as this
2020-04-06 22:46:40 +00:00
--> $DIR/if_same_then_else2.rs:95:13
2020-01-19 06:04:41 +00:00
|
LL | if true {
| _____________^
LL | | Ok("foo")?;
LL | | } else {
| |_____^
error: this `if` has identical blocks
2020-04-06 22:46:40 +00:00
--> $DIR/if_same_then_else2.rs:122:12
2020-01-19 06:04:41 +00:00
|
LL | } else {
| ____________^
LL | | let foo = "";
LL | | return Ok(&foo[0..]);
LL | | }
| |_____^
|
note: same as this
2020-04-06 22:46:40 +00:00
--> $DIR/if_same_then_else2.rs:119:20
2020-01-19 06:04:41 +00:00
|
LL | } else if true {
| ____________________^
LL | | let foo = "";
LL | | return Ok(&foo[0..]);
LL | | } else {
| |_____^
error: aborting due to 6 previous errors