2020-07-14 12:59:59 +00:00
|
|
|
error: match expression looks like `matches!` macro
|
2022-10-21 21:35:39 +00:00
|
|
|
--> $DIR/match_expr_like_matches_macro.rs:11:14
|
2020-07-14 12:59:59 +00:00
|
|
|
|
|
|
|
|
LL | let _y = match x {
|
|
|
|
| ______________^
|
|
|
|
LL | | Some(0) => true,
|
|
|
|
LL | | _ => false,
|
|
|
|
LL | | };
|
|
|
|
| |_____^ help: try this: `matches!(x, Some(0))`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::match-like-matches-macro` implied by `-D warnings`
|
|
|
|
|
|
|
|
error: match expression looks like `matches!` macro
|
2022-10-21 21:35:39 +00:00
|
|
|
--> $DIR/match_expr_like_matches_macro.rs:17:14
|
2020-07-14 12:59:59 +00:00
|
|
|
|
|
|
|
|
LL | let _w = match x {
|
|
|
|
| ______________^
|
|
|
|
LL | | Some(_) => true,
|
|
|
|
LL | | _ => false,
|
|
|
|
LL | | };
|
|
|
|
| |_____^ help: try this: `matches!(x, Some(_))`
|
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
2022-10-21 21:35:39 +00:00
|
|
|
--> $DIR/match_expr_like_matches_macro.rs:23:14
|
2020-07-14 12:59:59 +00:00
|
|
|
|
|
|
|
|
LL | let _z = match x {
|
|
|
|
| ______________^
|
|
|
|
LL | | Some(_) => false,
|
|
|
|
LL | | None => true,
|
|
|
|
LL | | };
|
|
|
|
| |_____^ help: try this: `x.is_none()`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
|
|
|
|
|
|
|
|
error: match expression looks like `matches!` macro
|
2022-10-21 21:35:39 +00:00
|
|
|
--> $DIR/match_expr_like_matches_macro.rs:29:15
|
2020-07-14 12:59:59 +00:00
|
|
|
|
|
|
|
|
LL | let _zz = match x {
|
|
|
|
| _______________^
|
|
|
|
LL | | Some(r) if r == 0 => false,
|
|
|
|
LL | | _ => true,
|
|
|
|
LL | | };
|
|
|
|
| |_____^ help: try this: `!matches!(x, Some(r) if r == 0)`
|
|
|
|
|
|
|
|
error: if let .. else expression looks like `matches!` macro
|
2022-10-21 21:35:39 +00:00
|
|
|
--> $DIR/match_expr_like_matches_macro.rs:35:16
|
2020-07-14 12:59:59 +00:00
|
|
|
|
|
|
|
|
LL | let _zzz = if let Some(5) = x { true } else { false };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `matches!(x, Some(5))`
|
|
|
|
|
2020-10-28 22:36:07 +00:00
|
|
|
error: match expression looks like `matches!` macro
|
2022-10-21 21:35:39 +00:00
|
|
|
--> $DIR/match_expr_like_matches_macro.rs:59: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 | | };
|
|
|
|
| |_________^ help: try this: `matches!(x, E::A(_) | E::B(_))`
|
|
|
|
|
|
|
|
error: match expression looks like `matches!` macro
|
2022-10-21 21:35:39 +00:00
|
|
|
--> $DIR/match_expr_like_matches_macro.rs:69:20
|
2022-07-15 06:15:31 +00:00
|
|
|
|
|
|
|
|
LL | let _ans = match x {
|
|
|
|
| ____________________^
|
|
|
|
LL | | E::A(_) => {
|
|
|
|
LL | | true
|
|
|
|
LL | | }
|
|
|
|
LL | | E::B(_) => true,
|
|
|
|
LL | | _ => false,
|
|
|
|
LL | | };
|
|
|
|
| |_________^ help: try this: `matches!(x, E::A(_) | E::B(_))`
|
|
|
|
|
|
|
|
error: match expression looks like `matches!` macro
|
2022-10-21 21:35:39 +00:00
|
|
|
--> $DIR/match_expr_like_matches_macro.rs:79: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 | | };
|
|
|
|
| |_________^ help: try this: `!matches!(x, E::B(_) | E::C)`
|
|
|
|
|
2021-01-30 17:06:34 +00:00
|
|
|
error: match expression looks like `matches!` macro
|
2022-10-21 21:35:39 +00:00
|
|
|
--> $DIR/match_expr_like_matches_macro.rs:139:18
|
2021-01-30 17:06:34 +00:00
|
|
|
|
|
|
|
|
LL | let _z = match &z {
|
|
|
|
| __________________^
|
|
|
|
LL | | Some(3) => true,
|
|
|
|
LL | | _ => false,
|
|
|
|
LL | | };
|
|
|
|
| |_________^ help: try this: `matches!(z, Some(3))`
|
|
|
|
|
|
|
|
error: match expression looks like `matches!` macro
|
2022-10-21 21:35:39 +00:00
|
|
|
--> $DIR/match_expr_like_matches_macro.rs:148:18
|
2021-01-30 17:06:34 +00:00
|
|
|
|
|
|
|
|
LL | let _z = match &z {
|
|
|
|
| __________________^
|
|
|
|
LL | | Some(3) => true,
|
|
|
|
LL | | _ => false,
|
|
|
|
LL | | };
|
|
|
|
| |_________^ help: try this: `matches!(&z, Some(3))`
|
|
|
|
|
|
|
|
error: match expression looks like `matches!` macro
|
2022-10-21 21:35:39 +00:00
|
|
|
--> $DIR/match_expr_like_matches_macro.rs:165:21
|
2021-01-30 17:06:34 +00:00
|
|
|
|
|
|
|
|
LL | let _ = match &z {
|
|
|
|
| _____________________^
|
|
|
|
LL | | AnEnum::X => true,
|
|
|
|
LL | | _ => false,
|
|
|
|
LL | | };
|
|
|
|
| |_____________^ help: try this: `matches!(&z, AnEnum::X)`
|
|
|
|
|
|
|
|
error: match expression looks like `matches!` macro
|
2022-10-21 21:35:39 +00:00
|
|
|
--> $DIR/match_expr_like_matches_macro.rs:179:20
|
2021-01-30 17:06:34 +00:00
|
|
|
|
|
|
|
|
LL | let _res = match &val {
|
|
|
|
| ____________________^
|
|
|
|
LL | | &Some(ref _a) => true,
|
|
|
|
LL | | _ => false,
|
|
|
|
LL | | };
|
|
|
|
| |_________^ help: try this: `matches!(&val, &Some(ref _a))`
|
|
|
|
|
|
|
|
error: match expression looks like `matches!` macro
|
2022-10-21 21:35:39 +00:00
|
|
|
--> $DIR/match_expr_like_matches_macro.rs:191:20
|
2021-01-30 17:06:34 +00:00
|
|
|
|
|
|
|
|
LL | let _res = match &val {
|
|
|
|
| ____________________^
|
|
|
|
LL | | &Some(ref _a) => true,
|
|
|
|
LL | | _ => false,
|
|
|
|
LL | | };
|
|
|
|
| |_________^ help: try this: `matches!(&val, &Some(ref _a))`
|
|
|
|
|
2022-10-21 21:35:39 +00:00
|
|
|
error: match expression looks like `matches!` macro
|
|
|
|
--> $DIR/match_expr_like_matches_macro.rs:251:14
|
|
|
|
|
|
|
|
|
LL | let _y = match Some(5) {
|
|
|
|
| ______________^
|
|
|
|
LL | | Some(0) => true,
|
|
|
|
LL | | _ => false,
|
|
|
|
LL | | };
|
|
|
|
| |_____^ help: try this: `matches!(Some(5), Some(0))`
|
|
|
|
|
|
|
|
error: aborting due to 14 previous errors
|
2020-07-14 12:59:59 +00:00
|
|
|
|