2020-01-19 06:04:41 +00:00
|
|
|
error: this `if` has identical blocks
|
2021-10-04 06:33:40 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:14: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 {
|
|
|
|
| |_____^
|
2020-12-11 22:29:53 +00:00
|
|
|
|
|
|
|
|
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
|
|
|
|
note: same as this
|
2021-10-04 06:33:40 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:23:12
|
2020-01-19 06:04:41 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
2020-12-11 22:29:53 +00:00
|
|
|
LL | | for _ in &[42] {
|
2021-02-23 20:16:19 +00:00
|
|
|
LL | | let bar: &Option<_> = &Some::<u8>(42);
|
2020-12-11 22:29:53 +00:00
|
|
|
... |
|
|
|
|
LL | | }
|
2020-01-19 06:04:41 +00:00
|
|
|
LL | | }
|
|
|
|
| |_____^
|
2020-12-11 22:29:53 +00:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2021-10-04 06:33:40 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:35:13
|
2020-01-19 06:04:41 +00:00
|
|
|
|
|
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
|
|
|
LL | | if let Some(a) = Some(42) {}
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2020-12-11 22:29:53 +00:00
|
|
|
|
|
|
|
|
note: same as this
|
2021-10-04 06:33:40 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:37:12
|
2020-01-19 06:04:41 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
2020-12-11 22:29:53 +00:00
|
|
|
LL | | if let Some(a) = Some(42) {}
|
2020-01-19 06:04:41 +00:00
|
|
|
LL | | }
|
|
|
|
| |_____^
|
2020-12-11 22:29:53 +00:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2021-10-04 06:33:40 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:42:13
|
2020-01-19 06:04:41 +00:00
|
|
|
|
|
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
|
|
|
LL | | if let (1, .., 3) = (1, 2, 3) {}
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2020-12-11 22:29:53 +00:00
|
|
|
|
|
|
|
|
note: same as this
|
2021-10-04 06:33:40 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:44:12
|
2020-01-19 06:04:41 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
2020-12-11 22:29:53 +00:00
|
|
|
LL | | if let (1, .., 3) = (1, 2, 3) {}
|
|
|
|
LL | | }
|
2020-01-19 06:04:41 +00:00
|
|
|
| |_____^
|
2020-12-11 22:29:53 +00:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2021-10-04 06:33:40 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:92:21
|
2020-01-19 06:04:41 +00:00
|
|
|
|
|
|
|
|
LL | let _ = if true {
|
|
|
|
| _____________________^
|
2020-04-07 22:04:33 +00:00
|
|
|
LL | | f32::NAN
|
2020-01-19 06:04:41 +00:00
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2020-12-11 22:29:53 +00:00
|
|
|
|
|
|
|
|
note: same as this
|
2021-10-04 06:33:40 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:94:12
|
2020-01-19 06:04:41 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | //~ ERROR same body as `if` block
|
2020-12-11 22:29:53 +00:00
|
|
|
LL | | f32::NAN
|
|
|
|
LL | | };
|
2020-01-19 06:04:41 +00:00
|
|
|
| |_____^
|
2020-12-11 22:29:53 +00:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2021-10-04 06:33:40 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:99:13
|
2020-01-19 06:04:41 +00:00
|
|
|
|
|
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
|
|
|
LL | | Ok("foo")?;
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2020-12-11 22:29:53 +00:00
|
|
|
|
|
|
|
|
note: same as this
|
2021-10-04 06:33:40 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:101:12
|
2020-01-19 06:04:41 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
2020-12-11 22:29:53 +00:00
|
|
|
LL | | //~ ERROR same body as `if` block
|
|
|
|
LL | | Ok("foo")?;
|
2020-01-19 06:04:41 +00:00
|
|
|
LL | | }
|
|
|
|
| |_____^
|
2020-12-11 22:29:53 +00:00
|
|
|
|
2021-02-25 22:33:46 +00:00
|
|
|
error: this `if` has identical blocks
|
2021-10-04 06:33:40 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:123:20
|
2021-02-25 22:33:46 +00:00
|
|
|
|
|
|
|
|
LL | } else if true {
|
|
|
|
| ____________________^
|
|
|
|
LL | | let foo = "";
|
|
|
|
LL | | return Ok(&foo[0..]);
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
note: same as this
|
2021-10-04 06:33:40 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:126:12
|
2021-02-25 22:33:46 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | let foo = "";
|
|
|
|
LL | | return Ok(&foo[0..]);
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
error: aborting due to 6 previous errors
|
2020-01-19 06:04:41 +00:00
|
|
|
|