2020-07-14 12:59:59 +00:00
|
|
|
error: match expression looks like `matches!` macro
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/match_expr_like_matches_macro.rs:14:14
|
2020-07-14 12:59:59 +00:00
|
|
|
|
|
|
|
|
LL | let _y = match x {
|
|
|
|
| ______________^
|
|
|
|
LL | | Some(0) => true,
|
|
|
|
LL | | _ => false,
|
|
|
|
LL | | };
|
2023-07-17 08:19:29 +00:00
|
|
|
| |_____^ help: try: `matches!(x, Some(0))`
|
2020-07-14 12:59:59 +00:00
|
|
|
|
|
|
|
|
= note: `-D clippy::match-like-matches-macro` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::match_like_matches_macro)]`
|
2020-07-14 12:59:59 +00:00
|
|
|
|
2023-05-20 13:39:26 +00:00
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/match_expr_like_matches_macro.rs:20:14
|
2020-07-14 12:59:59 +00:00
|
|
|
|
|
|
|
|
LL | let _w = match x {
|
|
|
|
| ______________^
|
|
|
|
LL | | Some(_) => true,
|
|
|
|
LL | | _ => false,
|
|
|
|
LL | | };
|
2023-07-17 08:19:29 +00:00
|
|
|
| |_____^ help: try: `x.is_some()`
|
2023-05-20 13:39:26 +00:00
|
|
|
|
|
|
|
|
= note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::redundant_pattern_matching)]`
|
2020-07-14 12:59:59 +00:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/match_expr_like_matches_macro.rs:26:14
|
2020-07-14 12:59:59 +00:00
|
|
|
|
|
|
|
|
LL | let _z = match x {
|
|
|
|
| ______________^
|
|
|
|
LL | | Some(_) => false,
|
|
|
|
LL | | None => true,
|
|
|
|
LL | | };
|
2023-07-17 08:19:29 +00:00
|
|
|
| |_____^ help: try: `x.is_none()`
|
2020-07-14 12:59:59 +00:00
|
|
|
|
|
|
|
error: match expression looks like `matches!` macro
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/match_expr_like_matches_macro.rs:32:15
|
2020-07-14 12:59:59 +00:00
|
|
|
|
|
|
|
|
LL | let _zz = match x {
|
|
|
|
| _______________^
|
|
|
|
LL | | Some(r) if r == 0 => false,
|
|
|
|
LL | | _ => true,
|
|
|
|
LL | | };
|
2023-07-17 08:19:29 +00:00
|
|
|
| |_____^ help: try: `!matches!(x, Some(r) if r == 0)`
|
2020-07-14 12:59:59 +00:00
|
|
|
|
|
|
|
error: if let .. else expression looks like `matches!` macro
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/match_expr_like_matches_macro.rs:38:16
|
2020-07-14 12:59:59 +00:00
|
|
|
|
|
|
|
|
LL | let _zzz = if let Some(5) = x { true } else { false };
|
2023-07-17 08:19:29 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(x, Some(5))`
|
2020-07-14 12:59:59 +00:00
|
|
|
|
2020-10-28 22:36:07 +00:00
|
|
|
error: match expression looks like `matches!` macro
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/match_expr_like_matches_macro.rs:62:20
|
2020-10-28 22:36:07 +00:00
|
|
|
|
|
|
|
|
LL | let _ans = match x {
|
|
|
|
| ____________________^
|
|
|
|
LL | | E::A(_) => true,
|
|
|
|
LL | | E::B(_) => true,
|
|
|
|
LL | | _ => false,
|
|
|
|
LL | | };
|
2023-07-17 08:19:29 +00:00
|
|
|
| |_________^ help: try: `matches!(x, E::A(_) | E::B(_))`
|
2020-10-28 22:36:07 +00:00
|
|
|
|
|
|
|
error: match expression looks like `matches!` macro
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/match_expr_like_matches_macro.rs:72:20
|
2022-07-18 07:39:37 +00:00
|
|
|
|
|
|
|
|
LL | let _ans = match x {
|
|
|
|
| ____________________^
|
|
|
|
LL | | E::A(_) => {
|
|
|
|
LL | | true
|
|
|
|
LL | | }
|
|
|
|
LL | | E::B(_) => true,
|
|
|
|
LL | | _ => false,
|
|
|
|
LL | | };
|
2023-07-17 08:19:29 +00:00
|
|
|
| |_________^ help: try: `matches!(x, E::A(_) | E::B(_))`
|
2022-07-18 07:39:37 +00:00
|
|
|
|
|
|
|
error: match expression looks like `matches!` macro
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/match_expr_like_matches_macro.rs:82:20
|
2020-10-28 22:36:07 +00:00
|
|
|
|
|
|
|
|
LL | let _ans = match x {
|
|
|
|
| ____________________^
|
|
|
|
LL | | E::B(_) => false,
|
|
|
|
LL | | E::C => false,
|
|
|
|
LL | | _ => true,
|
|
|
|
LL | | };
|
2023-07-17 08:19:29 +00:00
|
|
|
| |_________^ help: try: `!matches!(x, E::B(_) | E::C)`
|
2020-10-28 22:36:07 +00:00
|
|
|
|
2021-01-30 17:06:34 +00:00
|
|
|
error: match expression looks like `matches!` macro
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/match_expr_like_matches_macro.rs:142:18
|
2021-01-30 17:06:34 +00:00
|
|
|
|
|
|
|
|
LL | let _z = match &z {
|
|
|
|
| __________________^
|
|
|
|
LL | | Some(3) => true,
|
|
|
|
LL | | _ => false,
|
|
|
|
LL | | };
|
2023-07-17 08:19:29 +00:00
|
|
|
| |_________^ help: try: `matches!(z, Some(3))`
|
2021-01-30 17:06:34 +00:00
|
|
|
|
|
|
|
error: match expression looks like `matches!` macro
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/match_expr_like_matches_macro.rs:151:18
|
2021-01-30 17:06:34 +00:00
|
|
|
|
|
|
|
|
LL | let _z = match &z {
|
|
|
|
| __________________^
|
|
|
|
LL | | Some(3) => true,
|
|
|
|
LL | | _ => false,
|
|
|
|
LL | | };
|
2023-07-17 08:19:29 +00:00
|
|
|
| |_________^ help: try: `matches!(&z, Some(3))`
|
2021-01-30 17:06:34 +00:00
|
|
|
|
|
|
|
error: match expression looks like `matches!` macro
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/match_expr_like_matches_macro.rs:168:21
|
2021-01-30 17:06:34 +00:00
|
|
|
|
|
|
|
|
LL | let _ = match &z {
|
|
|
|
| _____________________^
|
|
|
|
LL | | AnEnum::X => true,
|
|
|
|
LL | | _ => false,
|
|
|
|
LL | | };
|
2023-07-17 08:19:29 +00:00
|
|
|
| |_____________^ help: try: `matches!(&z, AnEnum::X)`
|
2021-01-30 17:06:34 +00:00
|
|
|
|
|
|
|
error: match expression looks like `matches!` macro
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/match_expr_like_matches_macro.rs:182:20
|
2021-01-30 17:06:34 +00:00
|
|
|
|
|
|
|
|
LL | let _res = match &val {
|
|
|
|
| ____________________^
|
|
|
|
LL | | &Some(ref _a) => true,
|
|
|
|
LL | | _ => false,
|
|
|
|
LL | | };
|
2023-07-17 08:19:29 +00:00
|
|
|
| |_________^ help: try: `matches!(&val, &Some(ref _a))`
|
2021-01-30 17:06:34 +00:00
|
|
|
|
|
|
|
error: match expression looks like `matches!` macro
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/match_expr_like_matches_macro.rs:194:20
|
2021-01-30 17:06:34 +00:00
|
|
|
|
|
|
|
|
LL | let _res = match &val {
|
|
|
|
| ____________________^
|
|
|
|
LL | | &Some(ref _a) => true,
|
|
|
|
LL | | _ => false,
|
|
|
|
LL | | };
|
2023-07-17 08:19:29 +00:00
|
|
|
| |_________^ help: try: `matches!(&val, &Some(ref _a))`
|
2021-01-30 17:06:34 +00:00
|
|
|
|
2022-10-23 13:18:45 +00:00
|
|
|
error: match expression looks like `matches!` macro
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/match_expr_like_matches_macro.rs:252:14
|
2022-10-23 13:18:45 +00:00
|
|
|
|
|
|
|
|
LL | let _y = match Some(5) {
|
|
|
|
| ______________^
|
|
|
|
LL | | Some(0) => true,
|
|
|
|
LL | | _ => false,
|
|
|
|
LL | | };
|
2023-07-17 08:19:29 +00:00
|
|
|
| |_____^ help: try: `matches!(Some(5), Some(0))`
|
2022-10-23 13:18:45 +00:00
|
|
|
|
|
|
|
error: aborting due to 14 previous errors
|
2020-07-14 12:59:59 +00:00
|
|
|
|