@@ -77,49 +77,49 @@ LL | let _ = if let Some(_) = opt { true } else { false };
77
77
| -------^^^^^^^------ help: try this: `if opt.is_some()`
78
78
79
79
error: redundant pattern matching, consider using `is_some()`
80
- --> $DIR/redundant_pattern_matching_option.rs:60 :20
80
+ --> $DIR/redundant_pattern_matching_option.rs:61 :20
81
81
|
82
82
LL | let _ = if let Some(_) = gen_opt() {
83
83
| -------^^^^^^^------------ help: try this: `if gen_opt().is_some()`
84
84
85
85
error: redundant pattern matching, consider using `is_none()`
86
- --> $DIR/redundant_pattern_matching_option.rs:62 :19
86
+ --> $DIR/redundant_pattern_matching_option.rs:63 :19
87
87
|
88
88
LL | } else if let None = gen_opt() {
89
89
| -------^^^^------------ help: try this: `if gen_opt().is_none()`
90
90
91
91
error: redundant pattern matching, consider using `is_some()`
92
- --> $DIR/redundant_pattern_matching_option.rs:68 :12
92
+ --> $DIR/redundant_pattern_matching_option.rs:69 :12
93
93
|
94
94
LL | if let Some(..) = gen_opt() {}
95
95
| -------^^^^^^^^------------ help: try this: `if gen_opt().is_some()`
96
96
97
97
error: redundant pattern matching, consider using `is_some()`
98
- --> $DIR/redundant_pattern_matching_option.rs:83 :12
98
+ --> $DIR/redundant_pattern_matching_option.rs:84 :12
99
99
|
100
100
LL | if let Some(_) = Some(42) {}
101
101
| -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
102
102
103
103
error: redundant pattern matching, consider using `is_none()`
104
- --> $DIR/redundant_pattern_matching_option.rs:85 :12
104
+ --> $DIR/redundant_pattern_matching_option.rs:86 :12
105
105
|
106
106
LL | if let None = None::<()> {}
107
107
| -------^^^^------------- help: try this: `if None::<()>.is_none()`
108
108
109
109
error: redundant pattern matching, consider using `is_some()`
110
- --> $DIR/redundant_pattern_matching_option.rs:87 :15
110
+ --> $DIR/redundant_pattern_matching_option.rs:88 :15
111
111
|
112
112
LL | while let Some(_) = Some(42) {}
113
113
| ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
114
114
115
115
error: redundant pattern matching, consider using `is_none()`
116
- --> $DIR/redundant_pattern_matching_option.rs:89 :15
116
+ --> $DIR/redundant_pattern_matching_option.rs:90 :15
117
117
|
118
118
LL | while let None = None::<()> {}
119
119
| ----------^^^^------------- help: try this: `while None::<()>.is_none()`
120
120
121
121
error: redundant pattern matching, consider using `is_some()`
122
- --> $DIR/redundant_pattern_matching_option.rs:91 :5
122
+ --> $DIR/redundant_pattern_matching_option.rs:92 :5
123
123
|
124
124
LL | / match Some(42) {
125
125
LL | | Some(_) => true,
@@ -128,7 +128,7 @@ LL | | };
128
128
| |_____^ help: try this: `Some(42).is_some()`
129
129
130
130
error: redundant pattern matching, consider using `is_none()`
131
- --> $DIR/redundant_pattern_matching_option.rs:96 :5
131
+ --> $DIR/redundant_pattern_matching_option.rs:97 :5
132
132
|
133
133
LL | / match None::<()> {
134
134
LL | | Some(_) => false,
@@ -137,19 +137,19 @@ LL | | };
137
137
| |_____^ help: try this: `None::<()>.is_none()`
138
138
139
139
error: redundant pattern matching, consider using `is_none()`
140
- --> $DIR/redundant_pattern_matching_option.rs:104 :12
140
+ --> $DIR/redundant_pattern_matching_option.rs:105 :12
141
141
|
142
142
LL | if let None = *(&None::<()>) {}
143
143
| -------^^^^----------------- help: try this: `if (&None::<()>).is_none()`
144
144
145
145
error: redundant pattern matching, consider using `is_none()`
146
- --> $DIR/redundant_pattern_matching_option.rs:105 :12
146
+ --> $DIR/redundant_pattern_matching_option.rs:106 :12
147
147
|
148
148
LL | if let None = *&None::<()> {}
149
149
| -------^^^^--------------- help: try this: `if (&None::<()>).is_none()`
150
150
151
151
error: redundant pattern matching, consider using `is_some()`
152
- --> $DIR/redundant_pattern_matching_option.rs:111 :5
152
+ --> $DIR/redundant_pattern_matching_option.rs:112 :5
153
153
|
154
154
LL | / match x {
155
155
LL | | Some(_) => true,
@@ -158,7 +158,7 @@ LL | | };
158
158
| |_____^ help: try this: `x.is_some()`
159
159
160
160
error: redundant pattern matching, consider using `is_none()`
161
- --> $DIR/redundant_pattern_matching_option.rs:116 :5
161
+ --> $DIR/redundant_pattern_matching_option.rs:117 :5
162
162
|
163
163
LL | / match x {
164
164
LL | | None => true,
@@ -167,7 +167,7 @@ LL | | };
167
167
| |_____^ help: try this: `x.is_none()`
168
168
169
169
error: redundant pattern matching, consider using `is_none()`
170
- --> $DIR/redundant_pattern_matching_option.rs:121 :5
170
+ --> $DIR/redundant_pattern_matching_option.rs:122 :5
171
171
|
172
172
LL | / match x {
173
173
LL | | Some(_) => false,
@@ -176,13 +176,25 @@ LL | | };
176
176
| |_____^ help: try this: `x.is_none()`
177
177
178
178
error: redundant pattern matching, consider using `is_some()`
179
- --> $DIR/redundant_pattern_matching_option.rs:126 :5
179
+ --> $DIR/redundant_pattern_matching_option.rs:127 :5
180
180
|
181
181
LL | / match x {
182
182
LL | | None => false,
183
183
LL | | _ => true,
184
184
LL | | };
185
185
| |_____^ help: try this: `x.is_some()`
186
186
187
- error: aborting due to 26 previous errors
187
+ error: redundant pattern matching, consider using `is_some()`
188
+ --> $DIR/redundant_pattern_matching_option.rs:142:13
189
+ |
190
+ LL | let _ = matches!(x, Some(_));
191
+ | ^^^^^^^^^^^^^^^^^^^^ help: try this: `x.is_some()`
192
+
193
+ error: redundant pattern matching, consider using `is_none()`
194
+ --> $DIR/redundant_pattern_matching_option.rs:144:13
195
+ |
196
+ LL | let _ = matches!(x, None);
197
+ | ^^^^^^^^^^^^^^^^^ help: try this: `x.is_none()`
198
+
199
+ error: aborting due to 28 previous errors
188
200
0 commit comments