11error: this pattern matching can be expressed using equality
2- --> tests/ui/equatable_if_let.rs:64 :8
2+ --> tests/ui/equatable_if_let.rs:65 :8
33 |
44LL | if let 2 = a {}
55 | ^^^^^^^^^ help: try: `a == 2`
@@ -8,106 +8,124 @@ LL | if let 2 = a {}
88 = help: to override `-D warnings` add `#[allow(clippy::equatable_if_let)]`
99
1010error: this pattern matching can be expressed using equality
11- --> tests/ui/equatable_if_let.rs:66 :8
11+ --> tests/ui/equatable_if_let.rs:67 :8
1212 |
1313LL | if let Ordering::Greater = a.cmp(&b) {}
1414 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `a.cmp(&b) == Ordering::Greater`
1515
1616error: this pattern matching can be expressed using equality
17- --> tests/ui/equatable_if_let.rs:68 :8
17+ --> tests/ui/equatable_if_let.rs:69 :8
1818 |
1919LL | if let Some(2) = c {}
2020 | ^^^^^^^^^^^^^^^ help: try: `c == Some(2)`
2121
2222error: this pattern matching can be expressed using equality
23- --> tests/ui/equatable_if_let.rs:70 :8
23+ --> tests/ui/equatable_if_let.rs:71 :8
2424 |
2525LL | if let Struct { a: 2, b: false } = d {}
2626 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `d == (Struct { a: 2, b: false })`
2727
2828error: this pattern matching can be expressed using equality
29- --> tests/ui/equatable_if_let.rs:72 :8
29+ --> tests/ui/equatable_if_let.rs:73 :8
3030 |
3131LL | if let Enum::TupleVariant(32, 64) = e {}
3232 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `e == Enum::TupleVariant(32, 64)`
3333
3434error: this pattern matching can be expressed using equality
35- --> tests/ui/equatable_if_let.rs:74 :8
35+ --> tests/ui/equatable_if_let.rs:75 :8
3636 |
3737LL | if let Enum::RecordVariant { a: 64, b: 32 } = e {}
3838 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `e == (Enum::RecordVariant { a: 64, b: 32 })`
3939
4040error: this pattern matching can be expressed using equality
41- --> tests/ui/equatable_if_let.rs:76 :8
41+ --> tests/ui/equatable_if_let.rs:77 :8
4242 |
4343LL | if let Enum::UnitVariant = e {}
4444 | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `e == Enum::UnitVariant`
4545
4646error: this pattern matching can be expressed using equality
47- --> tests/ui/equatable_if_let.rs:78 :8
47+ --> tests/ui/equatable_if_let.rs:79 :8
4848 |
4949LL | if let (Enum::UnitVariant, &Struct { a: 2, b: false }) = (e, &d) {}
5050 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(e, &d) == (Enum::UnitVariant, &Struct { a: 2, b: false })`
5151
5252error: this pattern matching can be expressed using `matches!`
53- --> tests/ui/equatable_if_let.rs:88 :8
53+ --> tests/ui/equatable_if_let.rs:89 :8
5454 |
5555LL | if let NotPartialEq::A = f {}
5656 | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(f, NotPartialEq::A)`
5757
5858error: this pattern matching can be expressed using equality
59- --> tests/ui/equatable_if_let.rs:90 :8
59+ --> tests/ui/equatable_if_let.rs:91 :8
6060 |
6161LL | if let NotStructuralEq::A = g {}
6262 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `g == NotStructuralEq::A`
6363
6464error: this pattern matching can be expressed using `matches!`
65- --> tests/ui/equatable_if_let.rs:92 :8
65+ --> tests/ui/equatable_if_let.rs:93 :8
6666 |
6767LL | if let Some(NotPartialEq::A) = Some(f) {}
6868 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(Some(f), Some(NotPartialEq::A))`
6969
7070error: this pattern matching can be expressed using equality
71- --> tests/ui/equatable_if_let.rs:94 :8
71+ --> tests/ui/equatable_if_let.rs:95 :8
7272 |
7373LL | if let Some(NotStructuralEq::A) = Some(g) {}
7474 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Some(g) == Some(NotStructuralEq::A)`
7575
7676error: this pattern matching can be expressed using `matches!`
77- --> tests/ui/equatable_if_let.rs:96 :8
77+ --> tests/ui/equatable_if_let.rs:97 :8
7878 |
7979LL | if let NoPartialEqStruct { a: 2, b: false } = h {}
8080 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(h, NoPartialEqStruct { a: 2, b: false })`
8181
8282error: this pattern matching can be expressed using equality
83- --> tests/ui/equatable_if_let.rs:99 :8
83+ --> tests/ui/equatable_if_let.rs:100 :8
8484 |
8585LL | if let inline!("abc") = "abc" {
8686 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `"abc" == inline!("abc")`
8787
8888error: this pattern matching can be expressed using `matches!`
89- --> tests/ui/equatable_if_let.rs:109 :12
89+ --> tests/ui/equatable_if_let.rs:110 :12
9090 |
9191LL | if let Some('i') = cs.iter().next() {
9292 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(cs.iter().next(), Some('i'))`
9393
9494error: this pattern matching can be expressed using `matches!`
95- --> tests/ui/equatable_if_let.rs:117 :12
95+ --> tests/ui/equatable_if_let.rs:118 :12
9696 |
9797LL | if let Some(1) = cs.iter().next() {
9898 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(cs.iter().next(), Some(1))`
9999
100100error: this pattern matching can be expressed using `matches!`
101- --> tests/ui/equatable_if_let.rs:135 :12
101+ --> tests/ui/equatable_if_let.rs:136 :12
102102 |
103103LL | if let Some(MyEnum::B) = get_enum() {
104104 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(get_enum(), Some(MyEnum::B))`
105105
106106error: this pattern matching can be expressed using `matches!`
107- --> tests/ui/equatable_if_let.rs:145 :23
107+ --> tests/ui/equatable_if_let.rs:154 :23
108108 |
109- LL | const _: u32 = if let Some(true) = None { 0 } else { 1 };
110- | ^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(None, Some(true) )`
109+ LL | const _: u32 = if let NonConstEq = NonConstEq { 0 } else { 1 };
110+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(NonConstEq, NonConstEq )`
111111
112- error: aborting due to 18 previous errors
112+ error: this pattern matching can be expressed using equality
113+ --> tests/ui/equatable_if_let.rs:156:23
114+ |
115+ LL | const _: u32 = if let Some(NonConstEq) = None { 0 } else { 1 };
116+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `None == Some(NonConstEq)`
117+
118+ error: this pattern matching can be expressed using equality
119+ --> tests/ui/equatable_if_let.rs:167:23
120+ |
121+ LL | const _: u32 = if let ConstEq = ConstEq { 0 } else { 1 };
122+ | ^^^^^^^^^^^^^^^^^^^^^ help: try: `ConstEq == ConstEq`
123+
124+ error: this pattern matching can be expressed using equality
125+ --> tests/ui/equatable_if_let.rs:169:23
126+ |
127+ LL | const _: u32 = if let Some(ConstEq) = None { 0 } else { 1 };
128+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `None == Some(ConstEq)`
129+
130+ error: aborting due to 21 previous errors
113131
0 commit comments