]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/equatable_if_let.stderr
Auto merge of #105140 - flip1995:clippyup, r=Manishearth
[rust.git] / src / tools / clippy / tests / ui / equatable_if_let.stderr
1 error: this pattern matching can be expressed using equality
2   --> $DIR/equatable_if_let.rs:59:8
3    |
4 LL |     if let 2 = a {}
5    |        ^^^^^^^^^ help: try: `a == 2`
6    |
7    = note: `-D clippy::equatable-if-let` implied by `-D warnings`
8
9 error: this pattern matching can be expressed using equality
10   --> $DIR/equatable_if_let.rs:60:8
11    |
12 LL |     if let Ordering::Greater = a.cmp(&b) {}
13    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `a.cmp(&b) == Ordering::Greater`
14
15 error: this pattern matching can be expressed using equality
16   --> $DIR/equatable_if_let.rs:61:8
17    |
18 LL |     if let Some(2) = c {}
19    |        ^^^^^^^^^^^^^^^ help: try: `c == Some(2)`
20
21 error: this pattern matching can be expressed using equality
22   --> $DIR/equatable_if_let.rs:62:8
23    |
24 LL |     if let Struct { a: 2, b: false } = d {}
25    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `d == (Struct { a: 2, b: false })`
26
27 error: this pattern matching can be expressed using equality
28   --> $DIR/equatable_if_let.rs:63:8
29    |
30 LL |     if let Enum::TupleVariant(32, 64) = e {}
31    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `e == Enum::TupleVariant(32, 64)`
32
33 error: this pattern matching can be expressed using equality
34   --> $DIR/equatable_if_let.rs:64:8
35    |
36 LL |     if let Enum::RecordVariant { a: 64, b: 32 } = e {}
37    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `e == (Enum::RecordVariant { a: 64, b: 32 })`
38
39 error: this pattern matching can be expressed using equality
40   --> $DIR/equatable_if_let.rs:65:8
41    |
42 LL |     if let Enum::UnitVariant = e {}
43    |        ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `e == Enum::UnitVariant`
44
45 error: this pattern matching can be expressed using equality
46   --> $DIR/equatable_if_let.rs:66:8
47    |
48 LL |     if let (Enum::UnitVariant, &Struct { a: 2, b: false }) = (e, &d) {}
49    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(e, &d) == (Enum::UnitVariant, &Struct { a: 2, b: false })`
50
51 error: this pattern matching can be expressed using `matches!`
52   --> $DIR/equatable_if_let.rs:75:8
53    |
54 LL |     if let NotPartialEq::A = f {}
55    |        ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(f, NotPartialEq::A)`
56
57 error: this pattern matching can be expressed using equality
58   --> $DIR/equatable_if_let.rs:76:8
59    |
60 LL |     if let NotStructuralEq::A = g {}
61    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `g == NotStructuralEq::A`
62
63 error: this pattern matching can be expressed using `matches!`
64   --> $DIR/equatable_if_let.rs:77:8
65    |
66 LL |     if let Some(NotPartialEq::A) = Some(f) {}
67    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(Some(f), Some(NotPartialEq::A))`
68
69 error: this pattern matching can be expressed using equality
70   --> $DIR/equatable_if_let.rs:78:8
71    |
72 LL |     if let Some(NotStructuralEq::A) = Some(g) {}
73    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Some(g) == Some(NotStructuralEq::A)`
74
75 error: this pattern matching can be expressed using `matches!`
76   --> $DIR/equatable_if_let.rs:79:8
77    |
78 LL |     if let NoPartialEqStruct { a: 2, b: false } = h {}
79    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(h, NoPartialEqStruct { a: 2, b: false })`
80
81 error: this pattern matching can be expressed using equality
82   --> $DIR/equatable_if_let.rs:86:8
83    |
84 LL |     if let m1!(x) = "abc" {
85    |        ^^^^^^^^^^^^^^^^^^ help: try: `"abc" == m1!(x)`
86
87 error: aborting due to 14 previous errors
88