rust/tests/ui/if_same_then_else2.stderr

140 lines
3.1 KiB
Plaintext
Raw Normal View History

2020-01-19 06:04:41 +00:00
error: this `if` has identical blocks
--> $DIR/if_same_then_else2.rs:21:12
2020-01-19 06:04:41 +00:00
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | for _ in &[42] {
2021-02-17 15:34:35 +00:00
LL | | let bar: &Option<_> = &Some::<u8>(42);
2020-01-19 06:04:41 +00:00
... |
LL | | }
LL | | }
| |_____^
|
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
note: same as this
--> $DIR/if_same_then_else2.rs:12:13
2020-01-19 06:04:41 +00:00
|
LL | if true {
| _____________^
LL | | for _ in &[42] {
LL | | let foo: &Option<_> = &Some::<u8>(42);
2021-02-17 15:34:35 +00:00
LL | | if foo.is_some() {
2020-01-19 06:04:41 +00:00
... |
LL | | }
LL | | } else {
| |_____^
|
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
note: same as this
--> $DIR/if_same_then_else2.rs:22: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 | | }
2020-01-19 06:04:41 +00:00
LL | | }
| |_____^
error: this `if` has identical blocks
--> $DIR/if_same_then_else2.rs:34:13
2020-01-19 06:04:41 +00:00
|
LL | if true {
| _____________^
LL | | if let Some(a) = Some(42) {}
LL | | } else {
| |_____^
|
note: same as this
--> $DIR/if_same_then_else2.rs:36: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) {}
2020-01-19 06:04:41 +00:00
LL | | }
| |_____^
error: this `if` has identical blocks
--> $DIR/if_same_then_else2.rs:41:13
2020-01-19 06:04:41 +00:00
|
LL | if true {
| _____________^
LL | | if let (1, .., 3) = (1, 2, 3) {}
LL | | } else {
| |_____^
|
note: same as this
--> $DIR/if_same_then_else2.rs:43: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 | | }
2020-01-19 06:04:41 +00:00
| |_____^
error: this `if` has identical blocks
--> $DIR/if_same_then_else2.rs:91: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 {
| |_____^
|
note: same as this
--> $DIR/if_same_then_else2.rs:93:12
2020-01-19 06:04:41 +00:00
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | f32::NAN
LL | | };
2020-01-19 06:04:41 +00:00
| |_____^
error: this `if` has identical blocks
--> $DIR/if_same_then_else2.rs:98:13
2020-01-19 06:04:41 +00:00
|
LL | if true {
| _____________^
LL | | Ok("foo")?;
LL | | } else {
| |_____^
|
note: same as this
--> $DIR/if_same_then_else2.rs:100:12
2020-01-19 06:04:41 +00:00
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | Ok("foo")?;
2020-01-19 06:04:41 +00:00
LL | | }
| |_____^
error: this `if` has identical blocks
--> $DIR/if_same_then_else2.rs:122:20
2020-01-19 06:04:41 +00:00
|
LL | } else if true {
| ____________________^
LL | | let foo = "";
LL | | return Ok(&foo[0..]);
LL | | } else {
| |_____^
|
note: same as this
--> $DIR/if_same_then_else2.rs:125:12
|
LL | } else {
| ____________^
LL | | let foo = "";
LL | | return Ok(&foo[0..]);
LL | | }
| |_____^
2020-01-19 06:04:41 +00:00
error: aborting due to 6 previous errors