2021-10-07 09:21:30 +00:00
|
|
|
error: this pattern matching can be expressed using equality
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/equatable_if_let.rs:64:8
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | if let 2 = a {}
|
|
|
|
| ^^^^^^^^^ help: try: `a == 2`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::equatable-if-let` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::equatable_if_let)]`
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
error: this pattern matching can be expressed using equality
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/equatable_if_let.rs:65:8
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | if let Ordering::Greater = a.cmp(&b) {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `a.cmp(&b) == Ordering::Greater`
|
|
|
|
|
|
|
|
error: this pattern matching can be expressed using equality
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/equatable_if_let.rs:66:8
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | if let Some(2) = c {}
|
|
|
|
| ^^^^^^^^^^^^^^^ help: try: `c == Some(2)`
|
|
|
|
|
|
|
|
error: this pattern matching can be expressed using equality
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/equatable_if_let.rs:67:8
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | if let Struct { a: 2, b: false } = d {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `d == (Struct { a: 2, b: false })`
|
|
|
|
|
|
|
|
error: this pattern matching can be expressed using equality
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/equatable_if_let.rs:68:8
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | if let Enum::TupleVariant(32, 64) = e {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `e == Enum::TupleVariant(32, 64)`
|
|
|
|
|
|
|
|
error: this pattern matching can be expressed using equality
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/equatable_if_let.rs:69:8
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | if let Enum::RecordVariant { a: 64, b: 32 } = e {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `e == (Enum::RecordVariant { a: 64, b: 32 })`
|
|
|
|
|
|
|
|
error: this pattern matching can be expressed using equality
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/equatable_if_let.rs:70:8
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | if let Enum::UnitVariant = e {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `e == Enum::UnitVariant`
|
|
|
|
|
|
|
|
error: this pattern matching can be expressed using equality
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/equatable_if_let.rs:71:8
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | if let (Enum::UnitVariant, &Struct { a: 2, b: false }) = (e, &d) {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(e, &d) == (Enum::UnitVariant, &Struct { a: 2, b: false })`
|
|
|
|
|
2022-11-21 19:34:47 +00:00
|
|
|
error: this pattern matching can be expressed using `matches!`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/equatable_if_let.rs:80:8
|
2022-11-21 19:34:47 +00:00
|
|
|
|
|
|
|
|
LL | if let NotPartialEq::A = f {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(f, NotPartialEq::A)`
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
error: this pattern matching can be expressed using equality
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/equatable_if_let.rs:81:8
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | if let NotStructuralEq::A = g {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `g == NotStructuralEq::A`
|
|
|
|
|
2022-11-21 19:34:47 +00:00
|
|
|
error: this pattern matching can be expressed using `matches!`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/equatable_if_let.rs:82:8
|
2022-11-21 19:34:47 +00:00
|
|
|
|
|
|
|
|
LL | if let Some(NotPartialEq::A) = Some(f) {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(Some(f), Some(NotPartialEq::A))`
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
error: this pattern matching can be expressed using equality
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/equatable_if_let.rs:83:8
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | if let Some(NotStructuralEq::A) = Some(g) {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Some(g) == Some(NotStructuralEq::A)`
|
|
|
|
|
2022-11-21 19:34:47 +00:00
|
|
|
error: this pattern matching can be expressed using `matches!`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/equatable_if_let.rs:84:8
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
2022-11-21 19:34:47 +00:00
|
|
|
LL | if let NoPartialEqStruct { a: 2, b: false } = h {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(h, NoPartialEqStruct { a: 2, b: false })`
|
|
|
|
|
|
|
|
error: this pattern matching can be expressed using equality
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/equatable_if_let.rs:86:8
|
2022-11-21 19:34:47 +00:00
|
|
|
|
|
2023-03-24 13:04:35 +00:00
|
|
|
LL | if let inline!("abc") = "abc" {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"abc" == inline!("abc")`
|
2021-10-21 11:11:36 +00:00
|
|
|
|
2022-11-21 19:34:47 +00:00
|
|
|
error: aborting due to 14 previous errors
|
2021-10-07 09:21:30 +00:00
|
|
|
|