| error: this pattern matching can be expressed using equality |
| --> tests/ui/equatable_if_let.rs:55:8 |
| | |
| LL | if let 2 = a {} |
| | ^^^^^^^^^ help: try: `a == 2` |
| | |
| = note: `-D clippy::equatable-if-let` implied by `-D warnings` |
| = help: to override `-D warnings` add `#[allow(clippy::equatable_if_let)]` |
| |
| error: this pattern matching can be expressed using equality |
| --> tests/ui/equatable_if_let.rs:57:8 |
| | |
| LL | if let Ordering::Greater = a.cmp(&b) {} |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `a.cmp(&b) == Ordering::Greater` |
| |
| error: this pattern matching can be expressed using equality |
| --> tests/ui/equatable_if_let.rs:59:8 |
| | |
| LL | if let Some(2) = c {} |
| | ^^^^^^^^^^^^^^^ help: try: `c == Some(2)` |
| |
| error: this pattern matching can be expressed using equality |
| --> tests/ui/equatable_if_let.rs:61:8 |
| | |
| 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 |
| --> tests/ui/equatable_if_let.rs:63:8 |
| | |
| LL | if let Enum::TupleVariant(32, 64) = e {} |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `e == Enum::TupleVariant(32, 64)` |
| |
| error: this pattern matching can be expressed using equality |
| --> tests/ui/equatable_if_let.rs:65:8 |
| | |
| 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 |
| --> tests/ui/equatable_if_let.rs:67:8 |
| | |
| LL | if let Enum::UnitVariant = e {} |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `e == Enum::UnitVariant` |
| |
| error: this pattern matching can be expressed using equality |
| --> tests/ui/equatable_if_let.rs:69:8 |
| | |
| LL | if let (Enum::UnitVariant, &Struct { a: 2, b: false }) = (e, &d) {} |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(e, &d) == (Enum::UnitVariant, &Struct { a: 2, b: false })` |
| |
| error: this pattern matching can be expressed using `matches!` |
| --> tests/ui/equatable_if_let.rs:79:8 |
| | |
| LL | if let NotPartialEq::A = f {} |
| | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(f, NotPartialEq::A)` |
| |
| error: this pattern matching can be expressed using equality |
| --> tests/ui/equatable_if_let.rs:81:8 |
| | |
| LL | if let NotStructuralEq::A = g {} |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `g == NotStructuralEq::A` |
| |
| error: this pattern matching can be expressed using `matches!` |
| --> tests/ui/equatable_if_let.rs:83:8 |
| | |
| LL | if let Some(NotPartialEq::A) = Some(f) {} |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(Some(f), Some(NotPartialEq::A))` |
| |
| error: this pattern matching can be expressed using equality |
| --> tests/ui/equatable_if_let.rs:85:8 |
| | |
| LL | if let Some(NotStructuralEq::A) = Some(g) {} |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Some(g) == Some(NotStructuralEq::A)` |
| |
| error: this pattern matching can be expressed using `matches!` |
| --> tests/ui/equatable_if_let.rs:87:8 |
| | |
| 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 `matches!` |
| --> tests/ui/equatable_if_let.rs:93:12 |
| | |
| LL | if let Some('i') = cs.iter().next() { |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(cs.iter().next(), Some('i'))` |
| |
| error: this pattern matching can be expressed using `matches!` |
| --> tests/ui/equatable_if_let.rs:101:12 |
| | |
| LL | if let Some(1) = cs.iter().next() { |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(cs.iter().next(), Some(1))` |
| |
| error: this pattern matching can be expressed using `matches!` |
| --> tests/ui/equatable_if_let.rs:119:12 |
| | |
| LL | if let Some(MyEnum::B) = get_enum() { |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(get_enum(), Some(MyEnum::B))` |
| |
| error: this pattern matching can be expressed using `matches!` |
| --> tests/ui/equatable_if_let.rs:210:23 |
| | |
| LL | const _: u32 = if let NonConstEq::A = N { 0 } else { 1 }; |
| | ^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(N, NonConstEq::A)` |
| |
| error: this pattern matching can be expressed using `matches!` |
| --> tests/ui/equatable_if_let.rs:212:23 |
| | |
| LL | const _: u32 = if let Some(NonConstEq::A) = Some(N) { 0 } else { 1 }; |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(Some(N), Some(NonConstEq::A))` |
| |
| error: aborting due to 18 previous errors |
| |