fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
6.5 KiB228 linesraw
1error: this `match` can be collapsed into the outer `match`
2  --> $DIR/collapsible_match.rs:13:20
3   |
4LL |           Ok(val) => match val {
5   |  ____________________^
6LL | |
7LL | |             Some(n) => foo(n),
8LL | |             _ => return,
9LL | |         },
10   | |_________^
11   |
12help: the outer pattern can be modified to include the inner pattern
13  --> $DIR/collapsible_match.rs:13:12
14   |
15LL |         Ok(val) => match val {
16   |            ^^^ replace this binding
17LL |
18LL |             Some(n) => foo(n),
19   |             ^^^^^^^ with this pattern
20   = note: `-D clippy::collapsible-match` implied by `-D warnings`
21   = help: to override `-D warnings` add `#[allow(clippy::collapsible_match)]`
22
23error: this `match` can be collapsed into the outer `match`
24  --> $DIR/collapsible_match.rs:23:20
25   |
26LL |           Ok(val) => match val {
27   |  ____________________^
28LL | |
29LL | |             Some(n) => foo(n),
30LL | |             _ => return,
31LL | |         },
32   | |_________^
33   |
34help: the outer pattern can be modified to include the inner pattern
35  --> $DIR/collapsible_match.rs:23:12
36   |
37LL |         Ok(val) => match val {
38   |            ^^^ replace this binding
39LL |
40LL |             Some(n) => foo(n),
41   |             ^^^^^^^ with this pattern
42
43error: this `if let` can be collapsed into the outer `if let`
44  --> $DIR/collapsible_match.rs:33:9
45   |
46LL | /         if let Some(n) = val {
47LL | |
48LL | |             take(n);
49LL | |         }
50   | |_________^
51   |
52help: the outer pattern can be modified to include the inner pattern
53  --> $DIR/collapsible_match.rs:32:15
54   |
55LL |     if let Ok(val) = res_opt {
56   |               ^^^ replace this binding
57LL |         if let Some(n) = val {
58   |                ^^^^^^^ with this pattern
59
60error: this `if let` can be collapsed into the outer `if let`
61  --> $DIR/collapsible_match.rs:41:9
62   |
63LL | /         if let Some(n) = val {
64LL | |
65LL | |             take(n);
66LL | |         } else {
67LL | |             return;
68LL | |         }
69   | |_________^
70   |
71help: the outer pattern can be modified to include the inner pattern
72  --> $DIR/collapsible_match.rs:40:15
73   |
74LL |     if let Ok(val) = res_opt {
75   |               ^^^ replace this binding
76LL |         if let Some(n) = val {
77   |                ^^^^^^^ with this pattern
78
79error: this `match` can be collapsed into the outer `if let`
80  --> $DIR/collapsible_match.rs:53:9
81   |
82LL | /         match val {
83LL | |
84LL | |             Some(n) => foo(n),
85LL | |             _ => (),
86LL | |         }
87   | |_________^
88   |
89help: the outer pattern can be modified to include the inner pattern
90  --> $DIR/collapsible_match.rs:52:15
91   |
92LL |     if let Ok(val) = res_opt {
93   |               ^^^ replace this binding
94...
95LL |             Some(n) => foo(n),
96   |             ^^^^^^^ with this pattern
97
98error: this `if let` can be collapsed into the outer `match`
99  --> $DIR/collapsible_match.rs:63:13
100   |
101LL | /             if let Some(n) = val {
102LL | |
103LL | |                 take(n);
104LL | |             }
105   | |_____________^
106   |
107help: the outer pattern can be modified to include the inner pattern
108  --> $DIR/collapsible_match.rs:62:12
109   |
110LL |         Ok(val) => {
111   |            ^^^ replace this binding
112LL |             if let Some(n) = val {
113   |                    ^^^^^^^ with this pattern
114
115error: this `match` can be collapsed into the outer `if let`
116  --> $DIR/collapsible_match.rs:73:9
117   |
118LL | /         match val {
119LL | |
120LL | |             Some(n) => foo(n),
121LL | |             _ => return,
122LL | |         }
123   | |_________^
124   |
125help: the outer pattern can be modified to include the inner pattern
126  --> $DIR/collapsible_match.rs:72:15
127   |
128LL |     if let Ok(val) = res_opt {
129   |               ^^^ replace this binding
130...
131LL |             Some(n) => foo(n),
132   |             ^^^^^^^ with this pattern
133
134error: this `if let` can be collapsed into the outer `match`
135  --> $DIR/collapsible_match.rs:85:13
136   |
137LL | /             if let Some(n) = val {
138LL | |
139LL | |                 take(n);
140LL | |             } else {
141LL | |                 return;
142LL | |             }
143   | |_____________^
144   |
145help: the outer pattern can be modified to include the inner pattern
146  --> $DIR/collapsible_match.rs:84:12
147   |
148LL |         Ok(val) => {
149   |            ^^^ replace this binding
150LL |             if let Some(n) = val {
151   |                    ^^^^^^^ with this pattern
152
153error: this `match` can be collapsed into the outer `match`
154  --> $DIR/collapsible_match.rs:97:20
155   |
156LL |           Ok(val) => match val {
157   |  ____________________^
158LL | |
159LL | |             Some(n) => foo(n),
160LL | |             None => return,
161LL | |         },
162   | |_________^
163   |
164help: the outer pattern can be modified to include the inner pattern
165  --> $DIR/collapsible_match.rs:97:12
166   |
167LL |         Ok(val) => match val {
168   |            ^^^ replace this binding
169LL |
170LL |             Some(n) => foo(n),
171   |             ^^^^^^^ with this pattern
172
173error: this `match` can be collapsed into the outer `match`
174  --> $DIR/collapsible_match.rs:107:22
175   |
176LL |           Some(val) => match val {
177   |  ______________________^
178LL | |
179LL | |             Some(n) => foo(n),
180LL | |             _ => return,
181LL | |         },
182   | |_________^
183   |
184help: the outer pattern can be modified to include the inner pattern
185  --> $DIR/collapsible_match.rs:107:14
186   |
187LL |         Some(val) => match val {
188   |              ^^^ replace this binding
189LL |
190LL |             Some(n) => foo(n),
191   |             ^^^^^^^ with this pattern
192
193error: this `if let` can be collapsed into the outer `if let`
194  --> $DIR/collapsible_match.rs:273:9
195   |
196LL | /         if let Some(u) = a {
197LL | |
198LL | |             println!("{u:?}")
199LL | |         }
200   | |_________^
201   |
202help: the outer pattern can be modified to include the inner pattern
203  --> $DIR/collapsible_match.rs:272:27
204   |
205LL |     if let Issue9647::A { a, .. } = x {
206   |                           ^ replace this binding
207LL |         if let Some(u) = a {
208   |                ^^^^^^^ with this pattern, prefixed by a:
209
210error: this `if let` can be collapsed into the outer `if let`
211  --> $DIR/collapsible_match.rs:282:9
212   |
213LL | /         if let Some(u) = a {
214LL | |
215LL | |             println!("{u}")
216LL | |         }
217   | |_________^
218   |
219help: the outer pattern can be modified to include the inner pattern
220  --> $DIR/collapsible_match.rs:281:35
221   |
222LL |     if let Issue9647::A { a: Some(a), .. } = x {
223   |                                   ^ replace this binding
224LL |         if let Some(u) = a {
225   |                ^^^^^^^ with this pattern
226
227error: aborting due to 12 previous errors
228