2023-07-31 16:53:53 -05:00
|
|
|
error: redundant guard
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/redundant_guards.rs:34:20
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | C(x, y) if let 1 = y => ..,
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: `-D clippy::redundant-guards` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::redundant_guards)]`
|
2023-07-31 16:53:53 -05:00
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - C(x, y) if let 1 = y => ..,
|
|
|
|
LL + C(x, 1) => ..,
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/redundant_guards.rs:40:20
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | Some(x) if matches!(x, Some(1) if true) => ..,
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL | Some(Some(1)) if true => ..,
|
|
|
|
| ~~~~~~~ ~~~~~~~
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/redundant_guards.rs:41:20
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | Some(x) if matches!(x, Some(1)) => {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - Some(x) if matches!(x, Some(1)) => {
|
|
|
|
LL + Some(Some(1)) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/redundant_guards.rs:45:20
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | Some(x) if let Some(1) = x => ..,
|
|
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - Some(x) if let Some(1) = x => ..,
|
|
|
|
LL + Some(Some(1)) => ..,
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/redundant_guards.rs:46:20
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | Some(x) if x == Some(2) => ..,
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - Some(x) if x == Some(2) => ..,
|
|
|
|
LL + Some(Some(2)) => ..,
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/redundant_guards.rs:47:20
|
2023-09-25 04:28:58 -05:00
|
|
|
|
|
|
|
|
LL | Some(x) if Some(2) == x => ..,
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - Some(x) if Some(2) == x => ..,
|
|
|
|
LL + Some(Some(2)) => ..,
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/redundant_guards.rs:72:20
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | B { e } if matches!(e, Some(A(2))) => ..,
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - B { e } if matches!(e, Some(A(2))) => ..,
|
|
|
|
LL + B { e: Some(A(2)) } => ..,
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/redundant_guards.rs:109:20
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | E::A(y) if y == "not from an or pattern" => {},
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - E::A(y) if y == "not from an or pattern" => {},
|
|
|
|
LL + E::A("not from an or pattern") => {},
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/redundant_guards.rs:116:14
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | x if matches!(x, Some(0)) => ..,
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - x if matches!(x, Some(0)) => ..,
|
|
|
|
LL + Some(0) => ..,
|
|
|
|
|
|
|
|
|
|
2023-09-25 04:28:58 -05:00
|
|
|
error: redundant guard
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/redundant_guards.rs:123:14
|
|
|
|
|
|
|
|
|
LL | i if i == -1 => {},
|
|
|
|
| ^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - i if i == -1 => {},
|
|
|
|
LL + -1 => {},
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
|
|
|
--> tests/ui/redundant_guards.rs:124:14
|
|
|
|
|
|
|
|
|
LL | i if i == 1 => {},
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - i if i == 1 => {},
|
|
|
|
LL + 1 => {},
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-05-02 10:26:44 -05:00
|
|
|
--> tests/ui/redundant_guards.rs:186:28
|
2023-09-25 04:28:58 -05:00
|
|
|
|
|
|
|
|
LL | Some(ref x) if x == &1 => {},
|
|
|
|
| ^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - Some(ref x) if x == &1 => {},
|
|
|
|
LL + Some(1) => {},
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-05-02 10:26:44 -05:00
|
|
|
--> tests/ui/redundant_guards.rs:187:28
|
2023-09-25 04:28:58 -05:00
|
|
|
|
|
|
|
|
LL | Some(ref x) if &1 == x => {},
|
|
|
|
| ^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - Some(ref x) if &1 == x => {},
|
|
|
|
LL + Some(1) => {},
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-05-02 10:26:44 -05:00
|
|
|
--> tests/ui/redundant_guards.rs:188:28
|
2023-09-25 04:28:58 -05:00
|
|
|
|
|
|
|
|
LL | Some(ref x) if let &2 = x => {},
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - Some(ref x) if let &2 = x => {},
|
|
|
|
LL + Some(2) => {},
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-05-02 10:26:44 -05:00
|
|
|
--> tests/ui/redundant_guards.rs:189:28
|
2023-09-25 04:28:58 -05:00
|
|
|
|
|
|
|
|
LL | Some(ref x) if matches!(x, &3) => {},
|
|
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - Some(ref x) if matches!(x, &3) => {},
|
|
|
|
LL + Some(3) => {},
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-05-02 10:26:44 -05:00
|
|
|
--> tests/ui/redundant_guards.rs:209:32
|
2023-09-25 04:28:58 -05:00
|
|
|
|
|
|
|
|
LL | B { ref c, .. } if c == &1 => {},
|
|
|
|
| ^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - B { ref c, .. } if c == &1 => {},
|
|
|
|
LL + B { c: 1, .. } => {},
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-05-02 10:26:44 -05:00
|
|
|
--> tests/ui/redundant_guards.rs:210:32
|
2023-09-25 04:28:58 -05:00
|
|
|
|
|
|
|
|
LL | B { ref c, .. } if &1 == c => {},
|
|
|
|
| ^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - B { ref c, .. } if &1 == c => {},
|
|
|
|
LL + B { c: 1, .. } => {},
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-05-02 10:26:44 -05:00
|
|
|
--> tests/ui/redundant_guards.rs:211:32
|
2023-09-25 04:28:58 -05:00
|
|
|
|
|
|
|
|
LL | B { ref c, .. } if let &1 = c => {},
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - B { ref c, .. } if let &1 = c => {},
|
|
|
|
LL + B { c: 1, .. } => {},
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-05-02 10:26:44 -05:00
|
|
|
--> tests/ui/redundant_guards.rs:212:32
|
2023-09-25 04:28:58 -05:00
|
|
|
|
|
|
|
|
LL | B { ref c, .. } if matches!(c, &1) => {},
|
|
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - B { ref c, .. } if matches!(c, &1) => {},
|
|
|
|
LL + B { c: 1, .. } => {},
|
|
|
|
|
|
|
|
|
|
2023-12-01 11:21:58 -06:00
|
|
|
error: redundant guard
|
2024-05-02 10:26:44 -05:00
|
|
|
--> tests/ui/redundant_guards.rs:222:26
|
2023-12-01 11:21:58 -06:00
|
|
|
|
|
|
|
|
LL | Some(Some(x)) if x.is_empty() => {},
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - Some(Some(x)) if x.is_empty() => {},
|
|
|
|
LL + Some(Some("")) => {},
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-05-02 10:26:44 -05:00
|
|
|
--> tests/ui/redundant_guards.rs:233:26
|
2023-12-01 11:21:58 -06:00
|
|
|
|
|
|
|
|
LL | Some(Some(x)) if x.is_empty() => {},
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - Some(Some(x)) if x.is_empty() => {},
|
|
|
|
LL + Some(Some([])) => {},
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-05-02 10:26:44 -05:00
|
|
|
--> tests/ui/redundant_guards.rs:238:26
|
2023-12-01 11:21:58 -06:00
|
|
|
|
|
|
|
|
LL | Some(Some(x)) if x.is_empty() => {},
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - Some(Some(x)) if x.is_empty() => {},
|
|
|
|
LL + Some(Some([])) => {},
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-05-02 10:26:44 -05:00
|
|
|
--> tests/ui/redundant_guards.rs:249:26
|
2023-12-01 11:21:58 -06:00
|
|
|
|
|
|
|
|
LL | Some(Some(x)) if x.starts_with(&[]) => {},
|
|
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - Some(Some(x)) if x.starts_with(&[]) => {},
|
|
|
|
LL + Some(Some([..])) => {},
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-05-02 10:26:44 -05:00
|
|
|
--> tests/ui/redundant_guards.rs:254:26
|
2023-12-01 11:21:58 -06:00
|
|
|
|
|
|
|
|
LL | Some(Some(x)) if x.starts_with(&[1]) => {},
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - Some(Some(x)) if x.starts_with(&[1]) => {},
|
|
|
|
LL + Some(Some([1, ..])) => {},
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-05-02 10:26:44 -05:00
|
|
|
--> tests/ui/redundant_guards.rs:259:26
|
2023-12-01 11:21:58 -06:00
|
|
|
|
|
|
|
|
LL | Some(Some(x)) if x.starts_with(&[1, 2]) => {},
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - Some(Some(x)) if x.starts_with(&[1, 2]) => {},
|
|
|
|
LL + Some(Some([1, 2, ..])) => {},
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-05-02 10:26:44 -05:00
|
|
|
--> tests/ui/redundant_guards.rs:264:26
|
2023-12-01 11:21:58 -06:00
|
|
|
|
|
|
|
|
LL | Some(Some(x)) if x.ends_with(&[1, 2]) => {},
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - Some(Some(x)) if x.ends_with(&[1, 2]) => {},
|
|
|
|
LL + Some(Some([.., 1, 2])) => {},
|
|
|
|
|
|
|
|
|
|
2024-02-27 08:25:18 -06:00
|
|
|
error: redundant guard
|
2024-05-02 10:26:44 -05:00
|
|
|
--> tests/ui/redundant_guards.rs:286:18
|
2024-02-27 08:25:18 -06:00
|
|
|
|
|
|
|
|
LL | y if y.is_empty() => {},
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - y if y.is_empty() => {},
|
|
|
|
LL + "" => {},
|
|
|
|
|
|
|
|
|
|
|
|
|
error: redundant guard
|
2024-05-02 10:26:44 -05:00
|
|
|
--> tests/ui/redundant_guards.rs:305:22
|
2024-02-27 08:25:18 -06:00
|
|
|
|
|
|
|
|
LL | y if y.is_empty() => {},
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL - y if y.is_empty() => {},
|
|
|
|
LL + "" => {},
|
|
|
|
|
|
|
|
|
|
|
|
|
error: aborting due to 28 previous errors
|
2023-07-31 16:53:53 -05:00
|
|
|
|