]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/question_mark.stderr
Auto merge of #102536 - scottmcm:lookup_line-tweak, r=jackh726
[rust.git] / src / tools / clippy / tests / ui / question_mark.stderr
1 error: this block may be rewritten with the `?` operator
2   --> $DIR/question_mark.rs:7:5
3    |
4 LL | /     if a.is_none() {
5 LL | |         return None;
6 LL | |     }
7    | |_____^ help: replace it with: `a?;`
8    |
9    = note: `-D clippy::question-mark` implied by `-D warnings`
10
11 error: this block may be rewritten with the `?` operator
12   --> $DIR/question_mark.rs:52:9
13    |
14 LL | /         if (self.opt).is_none() {
15 LL | |             return None;
16 LL | |         }
17    | |_________^ help: replace it with: `(self.opt)?;`
18
19 error: this block may be rewritten with the `?` operator
20   --> $DIR/question_mark.rs:56:9
21    |
22 LL | /         if self.opt.is_none() {
23 LL | |             return None
24 LL | |         }
25    | |_________^ help: replace it with: `self.opt?;`
26
27 error: this block may be rewritten with the `?` operator
28   --> $DIR/question_mark.rs:60:17
29    |
30 LL |           let _ = if self.opt.is_none() {
31    |  _________________^
32 LL | |             return None;
33 LL | |         } else {
34 LL | |             self.opt
35 LL | |         };
36    | |_________^ help: replace it with: `Some(self.opt?)`
37
38 error: this block may be rewritten with the `?` operator
39   --> $DIR/question_mark.rs:66:17
40    |
41 LL |           let _ = if let Some(x) = self.opt {
42    |  _________________^
43 LL | |             x
44 LL | |         } else {
45 LL | |             return None;
46 LL | |         };
47    | |_________^ help: replace it with: `self.opt?`
48
49 error: this block may be rewritten with the `?` operator
50   --> $DIR/question_mark.rs:83:9
51    |
52 LL | /         if self.opt.is_none() {
53 LL | |             return None;
54 LL | |         }
55    | |_________^ help: replace it with: `self.opt.as_ref()?;`
56
57 error: this block may be rewritten with the `?` operator
58   --> $DIR/question_mark.rs:91:9
59    |
60 LL | /         if self.opt.is_none() {
61 LL | |             return None;
62 LL | |         }
63    | |_________^ help: replace it with: `self.opt.as_ref()?;`
64
65 error: this block may be rewritten with the `?` operator
66   --> $DIR/question_mark.rs:99:9
67    |
68 LL | /         if self.opt.is_none() {
69 LL | |             return None;
70 LL | |         }
71    | |_________^ help: replace it with: `self.opt.as_ref()?;`
72
73 error: this block may be rewritten with the `?` operator
74   --> $DIR/question_mark.rs:106:26
75    |
76 LL |           let v: &Vec<_> = if let Some(ref v) = self.opt {
77    |  __________________________^
78 LL | |             v
79 LL | |         } else {
80 LL | |             return None;
81 LL | |         };
82    | |_________^ help: replace it with: `self.opt.as_ref()?`
83
84 error: this block may be rewritten with the `?` operator
85   --> $DIR/question_mark.rs:116:17
86    |
87 LL |           let v = if let Some(v) = self.opt {
88    |  _________________^
89 LL | |             v
90 LL | |         } else {
91 LL | |             return None;
92 LL | |         };
93    | |_________^ help: replace it with: `self.opt?`
94
95 error: this block may be rewritten with the `?` operator
96   --> $DIR/question_mark.rs:131:5
97    |
98 LL | /     if f().is_none() {
99 LL | |         return None;
100 LL | |     }
101    | |_____^ help: replace it with: `f()?;`
102
103 error: this block may be rewritten with the `?` operator
104   --> $DIR/question_mark.rs:143:13
105    |
106 LL |     let _ = if let Ok(x) = x { x } else { return x };
107    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `x?`
108
109 error: this block may be rewritten with the `?` operator
110   --> $DIR/question_mark.rs:145:5
111    |
112 LL | /     if x.is_err() {
113 LL | |         return x;
114 LL | |     }
115    | |_____^ help: replace it with: `x?;`
116
117 error: this block may be rewritten with the `?` operator
118   --> $DIR/question_mark.rs:193:5
119    |
120 LL | /     if let Err(err) = func_returning_result() {
121 LL | |         return Err(err);
122 LL | |     }
123    | |_____^ help: replace it with: `func_returning_result()?;`
124
125 error: this block may be rewritten with the `?` operator
126   --> $DIR/question_mark.rs:200:5
127    |
128 LL | /     if let Err(err) = func_returning_result() {
129 LL | |         return Err(err);
130 LL | |     }
131    | |_____^ help: replace it with: `func_returning_result()?;`
132
133 error: aborting due to 15 previous errors
134