2022-03-24 08:50:04 -05:00
|
|
|
error: this match arm has an identical body to the `_` wildcard arm
|
2024-07-25 11:29:17 -05:00
|
|
|
--> tests/ui/match_same_arms2.rs:19:9
|
2020-01-24 23:25:45 -06:00
|
|
|
|
|
2022-03-24 08:50:04 -05:00
|
|
|
LL | / 42 => {
|
2020-01-24 23:25:45 -06:00
|
|
|
LL | | foo();
|
|
|
|
LL | | let mut a = 42 + [23].len() as i32;
|
2024-01-25 12:17:36 -06:00
|
|
|
LL | | if true {
|
2020-01-24 23:25:45 -06:00
|
|
|
... |
|
|
|
|
LL | | },
|
2024-05-21 12:39:30 -05:00
|
|
|
LL | | _ => {
|
|
|
|
| |________^ help: try removing the arm
|
2020-01-24 23:25:45 -06:00
|
|
|
|
|
2022-03-24 08:50:04 -05:00
|
|
|
= help: or try changing either arm body
|
|
|
|
note: `_` wildcard arm here
|
2024-07-25 11:29:17 -05:00
|
|
|
--> tests/ui/match_same_arms2.rs:28:9
|
2020-01-24 23:25:45 -06:00
|
|
|
|
|
2022-03-24 08:50:04 -05:00
|
|
|
LL | / _ => {
|
2020-01-24 23:25:45 -06:00
|
|
|
LL | | foo();
|
|
|
|
LL | | let mut a = 42 + [23].len() as i32;
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | | if true {
|
2020-01-24 23:25:45 -06:00
|
|
|
... |
|
|
|
|
LL | | a
|
|
|
|
LL | | },
|
|
|
|
| |_________^
|
2022-09-22 11:04:22 -05:00
|
|
|
= note: `-D clippy::match-same-arms` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::match_same_arms)]`
|
2020-01-24 23:25:45 -06:00
|
|
|
|
2022-03-24 08:50:04 -05:00
|
|
|
error: this match arm has an identical body to another arm
|
2024-07-25 11:29:17 -05:00
|
|
|
--> tests/ui/match_same_arms2.rs:42:9
|
2020-01-24 23:25:45 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | 51 => foo(),
|
2024-05-21 12:39:30 -05:00
|
|
|
| ^^^^^^^^^^^
|
2020-01-24 23:25:45 -06:00
|
|
|
|
|
2024-05-21 12:39:30 -05:00
|
|
|
= help: try changing either arm body
|
|
|
|
help: or try merging the arm patterns
|
|
|
|
|
|
|
|
|
LL | 51 | 42 => foo(),
|
|
|
|
| ~~~~~~~
|
|
|
|
help: and remove this obsolete arm
|
|
|
|
|
|
|
|
|
LL - 42 => foo(),
|
2020-01-24 23:25:45 -06:00
|
|
|
|
|
|
|
|
|
2022-03-24 08:50:04 -05:00
|
|
|
error: this match arm has an identical body to another arm
|
2024-07-25 11:29:17 -05:00
|
|
|
--> tests/ui/match_same_arms2.rs:48:9
|
2020-01-24 23:25:45 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | None => 24,
|
2024-05-21 12:39:30 -05:00
|
|
|
| ^^^^^^^^^^
|
2020-01-24 23:25:45 -06:00
|
|
|
|
|
2024-05-21 12:39:30 -05:00
|
|
|
= help: try changing either arm body
|
|
|
|
help: or try merging the arm patterns
|
|
|
|
|
|
|
|
|
LL | None | Some(_) => 24,
|
|
|
|
| ~~~~~~~~~~~~~~
|
|
|
|
help: and remove this obsolete arm
|
|
|
|
|
|
|
|
|
LL - Some(_) => 24,
|
2020-01-24 23:25:45 -06:00
|
|
|
|
|
|
|
|
|
2022-03-24 08:50:04 -05:00
|
|
|
error: this match arm has an identical body to another arm
|
2024-07-25 11:29:17 -05:00
|
|
|
--> tests/ui/match_same_arms2.rs:70:9
|
2020-01-24 23:25:45 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | (None, Some(a)) => bar(a),
|
2024-05-21 12:39:30 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-01-24 23:25:45 -06:00
|
|
|
|
|
2024-05-21 12:39:30 -05:00
|
|
|
= help: try changing either arm body
|
|
|
|
help: or try merging the arm patterns
|
|
|
|
|
|
|
|
|
LL | (None, Some(a)) | (Some(a), None) => bar(a),
|
|
|
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
help: and remove this obsolete arm
|
|
|
|
|
|
|
|
|
LL - (Some(a), None) => bar(a),
|
2020-01-24 23:25:45 -06:00
|
|
|
|
|
|
|
|
|
2022-03-24 08:50:04 -05:00
|
|
|
error: this match arm has an identical body to another arm
|
2024-07-25 11:29:17 -05:00
|
|
|
--> tests/ui/match_same_arms2.rs:84:9
|
2024-02-27 08:25:18 -06:00
|
|
|
|
|
|
|
|
LL | (None, Some(a)) if a == 42 => a,
|
2024-05-21 12:39:30 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2024-02-27 08:25:18 -06:00
|
|
|
|
|
2024-05-21 12:39:30 -05:00
|
|
|
= help: try changing either arm body
|
|
|
|
help: or try merging the arm patterns
|
|
|
|
|
|
|
|
|
LL | (None, Some(a)) | (Some(a), None) if a == 42 => a,
|
|
|
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
help: and remove this obsolete arm
|
|
|
|
|
|
|
|
|
LL - (Some(a), None) if a == 42 => a,
|
2024-02-27 08:25:18 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
error: this match arm has an identical body to another arm
|
2024-07-25 11:29:17 -05:00
|
|
|
--> tests/ui/match_same_arms2.rs:89:9
|
2020-01-24 23:25:45 -06:00
|
|
|
|
|
|
|
|
LL | (Some(a), ..) => bar(a),
|
2024-05-21 12:39:30 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
2020-01-29 21:06:42 -06:00
|
|
|
|
|
2024-05-21 12:39:30 -05:00
|
|
|
= help: try changing either arm body
|
|
|
|
help: or try merging the arm patterns
|
|
|
|
|
|
|
|
|
LL | (Some(a), ..) | (.., Some(a)) => bar(a),
|
|
|
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
help: and remove this obsolete arm
|
|
|
|
|
|
|
|
|
LL - (.., Some(a)) => bar(a),
|
2020-01-29 21:06:42 -06:00
|
|
|
|
|
2022-03-24 08:50:04 -05:00
|
|
|
|
|
|
|
error: this match arm has an identical body to another arm
|
2024-07-25 11:29:17 -05:00
|
|
|
--> tests/ui/match_same_arms2.rs:123:9
|
2020-01-29 21:06:42 -06:00
|
|
|
|
|
|
|
|
LL | (Ok(x), Some(_)) => println!("ok {}", x),
|
2024-05-21 12:39:30 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-03-24 08:50:04 -05:00
|
|
|
|
|
2024-05-21 12:39:30 -05:00
|
|
|
= help: try changing either arm body
|
|
|
|
help: or try merging the arm patterns
|
|
|
|
|
|
|
|
|
LL | (Ok(x), Some(_)) | (Ok(_), Some(x)) => println!("ok {}", x),
|
|
|
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
help: and remove this obsolete arm
|
|
|
|
|
|
|
|
|
LL - (Ok(_), Some(x)) => println!("ok {}", x),
|
2022-03-24 08:50:04 -05:00
|
|
|
|
|
2020-01-29 21:06:42 -06:00
|
|
|
|
2022-03-24 08:50:04 -05:00
|
|
|
error: this match arm has an identical body to another arm
|
2024-07-25 11:29:17 -05:00
|
|
|
--> tests/ui/match_same_arms2.rs:139:9
|
2020-01-29 21:06:42 -06:00
|
|
|
|
|
|
|
|
LL | Ok(_) => println!("ok"),
|
2024-05-21 12:39:30 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
2020-01-29 21:06:42 -06:00
|
|
|
|
|
2024-05-21 12:39:30 -05:00
|
|
|
= help: try changing either arm body
|
|
|
|
help: or try merging the arm patterns
|
|
|
|
|
|
|
|
|
LL | Ok(_) | Ok(3) => println!("ok"),
|
|
|
|
| ~~~~~~~~~~~~~
|
|
|
|
help: and remove this obsolete arm
|
|
|
|
|
|
|
|
|
LL - Ok(3) => println!("ok"),
|
2020-01-29 21:06:42 -06:00
|
|
|
|
|
|
|
|
|
2022-03-24 08:50:04 -05:00
|
|
|
error: this match arm has an identical body to another arm
|
2024-07-25 11:29:17 -05:00
|
|
|
--> tests/ui/match_same_arms2.rs:166:9
|
2021-03-12 08:30:50 -06:00
|
|
|
|
|
2024-05-21 12:39:30 -05:00
|
|
|
LL | / 1 => {
|
2021-03-12 08:30:50 -06:00
|
|
|
LL | | empty!(0);
|
|
|
|
LL | | },
|
|
|
|
| |_________^
|
|
|
|
|
|
2024-05-21 12:39:30 -05:00
|
|
|
= help: try changing either arm body
|
|
|
|
help: or try merging the arm patterns
|
|
|
|
|
|
|
|
|
LL | 1 | 0 => {
|
|
|
|
| ~~~~~
|
|
|
|
help: and remove this obsolete arm
|
|
|
|
|
|
|
|
|
LL - 0 => {
|
|
|
|
LL - empty!(0);
|
|
|
|
LL - },
|
2021-03-12 08:30:50 -06:00
|
|
|
|
|
2020-10-28 17:36:07 -05:00
|
|
|
|
2022-03-24 08:50:04 -05:00
|
|
|
error: this match arm has an identical body to another arm
|
2024-07-25 11:29:17 -05:00
|
|
|
--> tests/ui/match_same_arms2.rs:217:9
|
2022-03-24 08:50:04 -05:00
|
|
|
|
|
|
|
|
LL | Foo::X(0) => 1,
|
2024-05-21 12:39:30 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
2022-03-24 08:50:04 -05:00
|
|
|
|
|
2024-05-21 12:39:30 -05:00
|
|
|
= help: try changing either arm body
|
|
|
|
help: or try merging the arm patterns
|
|
|
|
|
|
|
|
|
LL | Foo::X(0) | Foo::Z(_) => 1,
|
|
|
|
| ~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
help: and remove this obsolete arm
|
|
|
|
|
|
|
|
|
LL - Foo::Z(_) => 1,
|
2022-03-24 08:50:04 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
error: this match arm has an identical body to another arm
|
2024-07-25 11:29:17 -05:00
|
|
|
--> tests/ui/match_same_arms2.rs:227:9
|
2022-03-24 08:50:04 -05:00
|
|
|
|
|
|
|
|
LL | Foo::Z(_) => 1,
|
2024-05-21 12:39:30 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
2022-03-24 08:50:04 -05:00
|
|
|
|
|
2024-05-21 12:39:30 -05:00
|
|
|
= help: try changing either arm body
|
|
|
|
help: or try merging the arm patterns
|
|
|
|
|
|
|
|
|
LL | Foo::Z(_) | Foo::X(0) => 1,
|
|
|
|
| ~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
help: and remove this obsolete arm
|
|
|
|
|
|
|
|
|
LL - Foo::X(0) => 1,
|
2022-03-24 08:50:04 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
error: this match arm has an identical body to another arm
|
2024-07-25 11:29:17 -05:00
|
|
|
--> tests/ui/match_same_arms2.rs:250:9
|
2022-03-24 08:50:04 -05:00
|
|
|
|
|
|
|
|
LL | Some(Bar { y: 0, x: 5, .. }) => 1,
|
2024-05-21 12:39:30 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-03-24 08:50:04 -05:00
|
|
|
|
|
2024-05-21 12:39:30 -05:00
|
|
|
= help: try changing either arm body
|
|
|
|
help: or try merging the arm patterns
|
|
|
|
|
|
|
|
|
LL | Some(Bar { y: 0, x: 5, .. }) | Some(Bar { x: 0, y: 5, .. }) => 1,
|
|
|
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
help: and remove this obsolete arm
|
|
|
|
|
|
|
|
|
LL - Some(Bar { x: 0, y: 5, .. }) => 1,
|
2022-03-24 08:50:04 -05:00
|
|
|
|
|
|
|
|
|
2023-05-20 08:39:26 -05:00
|
|
|
error: this match arm has an identical body to another arm
|
2024-07-25 11:29:17 -05:00
|
|
|
--> tests/ui/match_same_arms2.rs:264:9
|
2023-05-20 08:39:26 -05:00
|
|
|
|
|
|
|
|
LL | 1 => cfg!(not_enable),
|
2024-05-21 12:39:30 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
2023-05-20 08:39:26 -05:00
|
|
|
|
|
2024-05-21 12:39:30 -05:00
|
|
|
= help: try changing either arm body
|
|
|
|
help: or try merging the arm patterns
|
|
|
|
|
|
|
|
|
LL | 1 | 0 => cfg!(not_enable),
|
|
|
|
| ~~~~~
|
|
|
|
help: and remove this obsolete arm
|
|
|
|
|
|
|
|
|
LL - 0 => cfg!(not_enable),
|
2023-05-20 08:39:26 -05:00
|
|
|
|
|
|
|
|
|
2024-06-13 05:30:48 -05:00
|
|
|
error: this match arm has an identical body to another arm
|
2024-07-25 11:29:17 -05:00
|
|
|
--> tests/ui/match_same_arms2.rs:280:17
|
2024-06-13 05:30:48 -05:00
|
|
|
|
|
|
|
|
LL | MaybeStaticStr::Borrowed(s) => s,
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: try changing either arm body
|
|
|
|
help: or try merging the arm patterns
|
|
|
|
|
|
|
|
|
LL | MaybeStaticStr::Borrowed(s) | MaybeStaticStr::Static(s) => s,
|
|
|
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
help: and remove this obsolete arm
|
|
|
|
|
|
|
|
|
LL - MaybeStaticStr::Static(s) => s,
|
|
|
|
|
|
|
|
|
|
|
|
|
error: aborting due to 14 previous errors
|
2020-01-24 23:25:45 -06:00
|
|
|
|