1
1
error: this block may be rewritten with the `?` operator
2
- --> tests/ui/question_mark.rs:7 :5
2
+ --> tests/ui/question_mark.rs:8 :5
3
3
|
4
4
LL | / if a.is_none() {
5
5
LL | |
@@ -11,7 +11,7 @@ LL | | }
11
11
= help: to override `-D warnings` add `#[allow(clippy::question_mark)]`
12
12
13
13
error: this block may be rewritten with the `?` operator
14
- --> tests/ui/question_mark.rs:53 :9
14
+ --> tests/ui/question_mark.rs:54 :9
15
15
|
16
16
LL | / if (self.opt).is_none() {
17
17
LL | |
@@ -20,7 +20,7 @@ LL | | }
20
20
| |_________^ help: replace it with: `(self.opt)?;`
21
21
22
22
error: this block may be rewritten with the `?` operator
23
- --> tests/ui/question_mark.rs:58 :9
23
+ --> tests/ui/question_mark.rs:59 :9
24
24
|
25
25
LL | / if self.opt.is_none() {
26
26
LL | |
@@ -29,7 +29,7 @@ LL | | }
29
29
| |_________^ help: replace it with: `self.opt?;`
30
30
31
31
error: this block may be rewritten with the `?` operator
32
- --> tests/ui/question_mark.rs:63 :17
32
+ --> tests/ui/question_mark.rs:64 :17
33
33
|
34
34
LL | let _ = if self.opt.is_none() {
35
35
| _________________^
@@ -41,7 +41,7 @@ LL | | };
41
41
| |_________^ help: replace it with: `Some(self.opt?)`
42
42
43
43
error: this block may be rewritten with the `?` operator
44
- --> tests/ui/question_mark.rs:70 :17
44
+ --> tests/ui/question_mark.rs:71 :17
45
45
|
46
46
LL | let _ = if let Some(x) = self.opt {
47
47
| _________________^
@@ -53,7 +53,7 @@ LL | | };
53
53
| |_________^ help: replace it with: `self.opt?`
54
54
55
55
error: this block may be rewritten with the `?` operator
56
- --> tests/ui/question_mark.rs:88 :9
56
+ --> tests/ui/question_mark.rs:89 :9
57
57
|
58
58
LL | / if self.opt.is_none() {
59
59
LL | |
@@ -62,7 +62,7 @@ LL | | }
62
62
| |_________^ help: replace it with: `self.opt.as_ref()?;`
63
63
64
64
error: this block may be rewritten with the `?` operator
65
- --> tests/ui/question_mark.rs:97 :9
65
+ --> tests/ui/question_mark.rs:98 :9
66
66
|
67
67
LL | / if self.opt.is_none() {
68
68
LL | |
@@ -71,7 +71,7 @@ LL | | }
71
71
| |_________^ help: replace it with: `self.opt.as_ref()?;`
72
72
73
73
error: this block may be rewritten with the `?` operator
74
- --> tests/ui/question_mark.rs:106 :9
74
+ --> tests/ui/question_mark.rs:107 :9
75
75
|
76
76
LL | / if self.opt.is_none() {
77
77
LL | |
@@ -80,7 +80,7 @@ LL | | }
80
80
| |_________^ help: replace it with: `self.opt.as_ref()?;`
81
81
82
82
error: this block may be rewritten with the `?` operator
83
- --> tests/ui/question_mark.rs:114 :26
83
+ --> tests/ui/question_mark.rs:115 :26
84
84
|
85
85
LL | let v: &Vec<_> = if let Some(ref v) = self.opt {
86
86
| __________________________^
@@ -92,7 +92,7 @@ LL | | };
92
92
| |_________^ help: replace it with: `self.opt.as_ref()?`
93
93
94
94
error: this block may be rewritten with the `?` operator
95
- --> tests/ui/question_mark.rs:125 :17
95
+ --> tests/ui/question_mark.rs:126 :17
96
96
|
97
97
LL | let v = if let Some(v) = self.opt {
98
98
| _________________^
@@ -104,7 +104,7 @@ LL | | };
104
104
| |_________^ help: replace it with: `self.opt?`
105
105
106
106
error: this block may be rewritten with the `?` operator
107
- --> tests/ui/question_mark.rs:147 :5
107
+ --> tests/ui/question_mark.rs:148 :5
108
108
|
109
109
LL | / if f().is_none() {
110
110
LL | |
@@ -113,7 +113,7 @@ LL | | }
113
113
| |_____^ help: replace it with: `f()?;`
114
114
115
115
error: this `match` expression can be replaced with `?`
116
- --> tests/ui/question_mark.rs:152 :16
116
+ --> tests/ui/question_mark.rs:153 :16
117
117
|
118
118
LL | let _val = match f() {
119
119
| ________________^
@@ -124,7 +124,7 @@ LL | | };
124
124
| |_____^ help: try instead: `f()?`
125
125
126
126
error: this `match` expression can be replaced with `?`
127
- --> tests/ui/question_mark.rs:163 :5
127
+ --> tests/ui/question_mark.rs:164 :5
128
128
|
129
129
LL | / match f() {
130
130
LL | |
@@ -134,7 +134,7 @@ LL | | };
134
134
| |_____^ help: try instead: `f()?`
135
135
136
136
error: this `match` expression can be replaced with `?`
137
- --> tests/ui/question_mark.rs:169 :5
137
+ --> tests/ui/question_mark.rs:170 :5
138
138
|
139
139
LL | / match opt_none!() {
140
140
LL | |
@@ -144,13 +144,13 @@ LL | | };
144
144
| |_____^ help: try instead: `opt_none!()?`
145
145
146
146
error: this block may be rewritten with the `?` operator
147
- --> tests/ui/question_mark.rs:196 :13
147
+ --> tests/ui/question_mark.rs:197 :13
148
148
|
149
149
LL | let _ = if let Ok(x) = x { x } else { return x };
150
150
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `x?`
151
151
152
152
error: this block may be rewritten with the `?` operator
153
- --> tests/ui/question_mark.rs:199 :5
153
+ --> tests/ui/question_mark.rs:200 :5
154
154
|
155
155
LL | / if x.is_err() {
156
156
LL | |
@@ -159,7 +159,7 @@ LL | | }
159
159
| |_____^ help: replace it with: `x?;`
160
160
161
161
error: this `match` expression can be replaced with `?`
162
- --> tests/ui/question_mark.rs:204 :16
162
+ --> tests/ui/question_mark.rs:205 :16
163
163
|
164
164
LL | let _val = match func_returning_result() {
165
165
| ________________^
@@ -170,7 +170,7 @@ LL | | };
170
170
| |_____^ help: try instead: `func_returning_result()?`
171
171
172
172
error: this `match` expression can be replaced with `?`
173
- --> tests/ui/question_mark.rs:210 :5
173
+ --> tests/ui/question_mark.rs:211 :5
174
174
|
175
175
LL | / match func_returning_result() {
176
176
LL | |
@@ -180,7 +180,7 @@ LL | | };
180
180
| |_____^ help: try instead: `func_returning_result()?`
181
181
182
182
error: this block may be rewritten with the `?` operator
183
- --> tests/ui/question_mark.rs:302 :5
183
+ --> tests/ui/question_mark.rs:303 :5
184
184
|
185
185
LL | / if let Err(err) = func_returning_result() {
186
186
LL | |
@@ -189,7 +189,7 @@ LL | | }
189
189
| |_____^ help: replace it with: `func_returning_result()?;`
190
190
191
191
error: this block may be rewritten with the `?` operator
192
- --> tests/ui/question_mark.rs:310 :5
192
+ --> tests/ui/question_mark.rs:311 :5
193
193
|
194
194
LL | / if let Err(err) = func_returning_result() {
195
195
LL | |
@@ -198,7 +198,7 @@ LL | | }
198
198
| |_____^ help: replace it with: `func_returning_result()?;`
199
199
200
200
error: this block may be rewritten with the `?` operator
201
- --> tests/ui/question_mark.rs:388 :13
201
+ --> tests/ui/question_mark.rs:389 :13
202
202
|
203
203
LL | / if a.is_none() {
204
204
LL | |
@@ -208,7 +208,7 @@ LL | | }
208
208
| |_____________^ help: replace it with: `a?;`
209
209
210
210
error: this `let...else` may be rewritten with the `?` operator
211
- --> tests/ui/question_mark.rs:449 :5
211
+ --> tests/ui/question_mark.rs:450 :5
212
212
|
213
213
LL | / let Some(v) = bar.foo.owned.clone() else {
214
214
LL | | return None;
0 commit comments