]> git.proxmox.com Git - rustc.git/blame - src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr
New upstream version 1.65.0+dfsg1
[rustc.git] / src / test / ui / rfc-2497-if-let-chains / disallowed-positions.stderr
CommitLineData
064997fb
FG
1error: expected expression, found `let` statement
2 --> $DIR/disallowed-positions.rs:29:9
3 |
4LL | if (let 0 = 1) {}
5 | ^^^
6
7error: expected expression, found `let` statement
8 --> $DIR/disallowed-positions.rs:33:11
9 |
10LL | if (((let 0 = 1))) {}
11 | ^^^
12
13error: expected expression, found `let` statement
14 --> $DIR/disallowed-positions.rs:37:9
15 |
16LL | if (let 0 = 1) && true {}
17 | ^^^
18
19error: expected expression, found `let` statement
20 --> $DIR/disallowed-positions.rs:41:17
21 |
22LL | if true && (let 0 = 1) {}
23 | ^^^
24
25error: expected expression, found `let` statement
26 --> $DIR/disallowed-positions.rs:45:9
27 |
28LL | if (let 0 = 1) && (let 0 = 1) {}
29 | ^^^
30
31error: expected expression, found `let` statement
32 --> $DIR/disallowed-positions.rs:45:24
33 |
34LL | if (let 0 = 1) && (let 0 = 1) {}
35 | ^^^
36
37error: expected expression, found `let` statement
38 --> $DIR/disallowed-positions.rs:51:35
39 |
40LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
41 | ^^^
42
43error: expected expression, found `let` statement
44 --> $DIR/disallowed-positions.rs:51:48
45 |
46LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
47 | ^^^
48
49error: expected expression, found `let` statement
50 --> $DIR/disallowed-positions.rs:51:61
51 |
52LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
53 | ^^^
54
55error: expected expression, found `let` statement
56 --> $DIR/disallowed-positions.rs:61:12
57 |
58LL | while (let 0 = 1) {}
59 | ^^^
60
61error: expected expression, found `let` statement
62 --> $DIR/disallowed-positions.rs:65:14
63 |
64LL | while (((let 0 = 1))) {}
65 | ^^^
66
67error: expected expression, found `let` statement
68 --> $DIR/disallowed-positions.rs:69:12
69 |
70LL | while (let 0 = 1) && true {}
71 | ^^^
72
73error: expected expression, found `let` statement
74 --> $DIR/disallowed-positions.rs:73:20
75 |
76LL | while true && (let 0 = 1) {}
77 | ^^^
78
79error: expected expression, found `let` statement
80 --> $DIR/disallowed-positions.rs:77:12
81 |
82LL | while (let 0 = 1) && (let 0 = 1) {}
83 | ^^^
84
85error: expected expression, found `let` statement
86 --> $DIR/disallowed-positions.rs:77:27
87 |
88LL | while (let 0 = 1) && (let 0 = 1) {}
89 | ^^^
90
91error: expected expression, found `let` statement
92 --> $DIR/disallowed-positions.rs:83:38
93 |
94LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
95 | ^^^
96
97error: expected expression, found `let` statement
98 --> $DIR/disallowed-positions.rs:83:51
99 |
100LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
101 | ^^^
102
103error: expected expression, found `let` statement
104 --> $DIR/disallowed-positions.rs:83:64
105 |
106LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
107 | ^^^
108
109error: expected expression, found `let` statement
110 --> $DIR/disallowed-positions.rs:110:9
111 |
112LL | if &let 0 = 0 {}
113 | ^^^
114
115error: expected expression, found `let` statement
116 --> $DIR/disallowed-positions.rs:115:9
117 |
118LL | if !let 0 = 0 {}
119 | ^^^
120
121error: expected expression, found `let` statement
122 --> $DIR/disallowed-positions.rs:118:9
123 |
124LL | if *let 0 = 0 {}
125 | ^^^
126
127error: expected expression, found `let` statement
128 --> $DIR/disallowed-positions.rs:122:9
129 |
130LL | if -let 0 = 0 {}
131 | ^^^
132
133error: expected expression, found `let` statement
134 --> $DIR/disallowed-positions.rs:132:9
135 |
136LL | if (let 0 = 0)? {}
137 | ^^^
138
139error: expected expression, found `let` statement
140 --> $DIR/disallowed-positions.rs:138:16
141 |
142LL | if true || let 0 = 0 {}
143 | ^^^
144
145error: expected expression, found `let` statement
146 --> $DIR/disallowed-positions.rs:141:17
147 |
148LL | if (true || let 0 = 0) {}
149 | ^^^
150
151error: expected expression, found `let` statement
152 --> $DIR/disallowed-positions.rs:144:25
153 |
154LL | if true && (true || let 0 = 0) {}
155 | ^^^
156
157error: expected expression, found `let` statement
158 --> $DIR/disallowed-positions.rs:147:25
159 |
160LL | if true || (true && let 0 = 0) {}
161 | ^^^
162
163error: expected expression, found `let` statement
164 --> $DIR/disallowed-positions.rs:152:12
165 |
166LL | if x = let 0 = 0 {}
167 | ^^^
168
169error: expected expression, found `let` statement
170 --> $DIR/disallowed-positions.rs:157:15
171 |
172LL | if true..(let 0 = 0) {}
173 | ^^^
174
175error: expected expression, found `let` statement
176 --> $DIR/disallowed-positions.rs:161:11
177 |
178LL | if ..(let 0 = 0) {}
179 | ^^^
180
181error: expected expression, found `let` statement
182 --> $DIR/disallowed-positions.rs:165:9
183 |
184LL | if (let 0 = 0).. {}
185 | ^^^
186
187error: expected expression, found `let` statement
188 --> $DIR/disallowed-positions.rs:196:19
189 |
190LL | if let true = let true = true {}
191 | ^^^
192
193error: expected expression, found `let` statement
194 --> $DIR/disallowed-positions.rs:202:12
195 |
196LL | while &let 0 = 0 {}
197 | ^^^
198
199error: expected expression, found `let` statement
200 --> $DIR/disallowed-positions.rs:207:12
201 |
202LL | while !let 0 = 0 {}
203 | ^^^
204
205error: expected expression, found `let` statement
206 --> $DIR/disallowed-positions.rs:210:12
207 |
208LL | while *let 0 = 0 {}
209 | ^^^
210
211error: expected expression, found `let` statement
212 --> $DIR/disallowed-positions.rs:214:12
213 |
214LL | while -let 0 = 0 {}
215 | ^^^
216
217error: expected expression, found `let` statement
218 --> $DIR/disallowed-positions.rs:224:12
219 |
220LL | while (let 0 = 0)? {}
221 | ^^^
222
223error: expected expression, found `let` statement
224 --> $DIR/disallowed-positions.rs:230:19
225 |
226LL | while true || let 0 = 0 {}
227 | ^^^
228
229error: expected expression, found `let` statement
230 --> $DIR/disallowed-positions.rs:233:20
231 |
232LL | while (true || let 0 = 0) {}
233 | ^^^
234
235error: expected expression, found `let` statement
236 --> $DIR/disallowed-positions.rs:236:28
237 |
238LL | while true && (true || let 0 = 0) {}
239 | ^^^
240
241error: expected expression, found `let` statement
242 --> $DIR/disallowed-positions.rs:239:28
243 |
244LL | while true || (true && let 0 = 0) {}
245 | ^^^
246
247error: expected expression, found `let` statement
248 --> $DIR/disallowed-positions.rs:244:15
249 |
250LL | while x = let 0 = 0 {}
251 | ^^^
252
253error: expected expression, found `let` statement
254 --> $DIR/disallowed-positions.rs:249:18
255 |
256LL | while true..(let 0 = 0) {}
257 | ^^^
258
259error: expected expression, found `let` statement
260 --> $DIR/disallowed-positions.rs:253:14
261 |
262LL | while ..(let 0 = 0) {}
263 | ^^^
264
265error: expected expression, found `let` statement
266 --> $DIR/disallowed-positions.rs:257:12
267 |
268LL | while (let 0 = 0).. {}
269 | ^^^
270
271error: expected expression, found `let` statement
272 --> $DIR/disallowed-positions.rs:288:22
273 |
274LL | while let true = let true = true {}
275 | ^^^
276
277error: expected expression, found `let` statement
278 --> $DIR/disallowed-positions.rs:304:6
279 |
280LL | &let 0 = 0;
281 | ^^^
282
283error: expected expression, found `let` statement
284 --> $DIR/disallowed-positions.rs:308:6
285 |
286LL | !let 0 = 0;
287 | ^^^
288
289error: expected expression, found `let` statement
290 --> $DIR/disallowed-positions.rs:311:6
291 |
292LL | *let 0 = 0;
293 | ^^^
294
295error: expected expression, found `let` statement
296 --> $DIR/disallowed-positions.rs:315:6
297 |
298LL | -let 0 = 0;
299 | ^^^
300
301error: expected expression, found `let` statement
302 --> $DIR/disallowed-positions.rs:325:6
303 |
304LL | (let 0 = 0)?;
305 | ^^^
306
307error: expected expression, found `let` statement
308 --> $DIR/disallowed-positions.rs:331:13
309 |
310LL | true || let 0 = 0;
311 | ^^^
312
313error: expected expression, found `let` statement
314 --> $DIR/disallowed-positions.rs:334:14
315 |
316LL | (true || let 0 = 0);
317 | ^^^
318
319error: expected expression, found `let` statement
320 --> $DIR/disallowed-positions.rs:337:22
321 |
322LL | true && (true || let 0 = 0);
323 | ^^^
324
325error: expected expression, found `let` statement
326 --> $DIR/disallowed-positions.rs:342:9
327 |
328LL | x = let 0 = 0;
329 | ^^^
330
331error: expected expression, found `let` statement
332 --> $DIR/disallowed-positions.rs:346:12
333 |
334LL | true..(let 0 = 0);
335 | ^^^
336
337error: expected expression, found `let` statement
338 --> $DIR/disallowed-positions.rs:349:8
339 |
340LL | ..(let 0 = 0);
341 | ^^^
342
343error: expected expression, found `let` statement
344 --> $DIR/disallowed-positions.rs:352:6
345 |
346LL | (let 0 = 0)..;
347 | ^^^
348
349error: expected expression, found `let` statement
350 --> $DIR/disallowed-positions.rs:356:6
351 |
352LL | (let Range { start: _, end: _ } = true..true || false);
353 | ^^^
354
355error: expected expression, found `let` statement
356 --> $DIR/disallowed-positions.rs:361:6
357 |
358LL | (let true = let true = true);
359 | ^^^
360
361error: expected expression, found `let` statement
362 --> $DIR/disallowed-positions.rs:361:17
363 |
364LL | (let true = let true = true);
365 | ^^^
366
367error: expected expression, found `let` statement
368 --> $DIR/disallowed-positions.rs:368:25
369 |
370LL | let x = true && let y = 1;
371 | ^^^
372
373error: expected expression, found `let` statement
374 --> $DIR/disallowed-positions.rs:374:19
375 |
376LL | [1, 2, 3][let _ = ()]
377 | ^^^
378
379error: expected expression, found `let` statement
380 --> $DIR/disallowed-positions.rs:379:6
381 |
382LL | &let 0 = 0
383 | ^^^
384
385error: expected expression, found `let` statement
386 --> $DIR/disallowed-positions.rs:391:17
387 |
388LL | true && let 1 = 1
389 | ^^^
390
391error: expected expression, found `let` statement
392 --> $DIR/disallowed-positions.rs:397:17
393 |
394LL | true && let 1 = 1
395 | ^^^
396
397error: expected expression, found `let` statement
398 --> $DIR/disallowed-positions.rs:403:17
399 |
400LL | true && let 1 = 1
401 | ^^^
402
403error: expected expression, found `let` statement
404 --> $DIR/disallowed-positions.rs:415:17
405 |
406LL | true && let 1 = 1
407 | ^^^
408
29967ef6 409error: expressions must be enclosed in braces to be used as const generic arguments
064997fb 410 --> $DIR/disallowed-positions.rs:415:9
dc9dc135
XL
411 |
412LL | true && let 1 = 1
29967ef6
XL
413 | ^^^^^^^^^^^^^^^^^
414 |
415help: enclose the `const` expression in braces
416 |
417LL | { true && let 1 = 1 }
94222f64 418 | + +
dc9dc135 419
064997fb
FG
420error: expected expression, found `let` statement
421 --> $DIR/disallowed-positions.rs:425:9
422 |
423LL | if (let Some(a) = opt && true) {
424 | ^^^
425
426error: expected expression, found `let` statement
427 --> $DIR/disallowed-positions.rs:430:9
428 |
429LL | if (let Some(a) = opt) && true {
430 | ^^^
431
432error: expected expression, found `let` statement
433 --> $DIR/disallowed-positions.rs:434:9
434 |
435LL | if (let Some(a) = opt) && (let Some(b) = a) {
436 | ^^^
437
438error: expected expression, found `let` statement
439 --> $DIR/disallowed-positions.rs:434:32
440 |
441LL | if (let Some(a) = opt) && (let Some(b) = a) {
442 | ^^^
443
444error: expected expression, found `let` statement
445 --> $DIR/disallowed-positions.rs:443:9
446 |
447LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
448 | ^^^
449
450error: expected expression, found `let` statement
451 --> $DIR/disallowed-positions.rs:443:31
452 |
453LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
454 | ^^^
455
456error: expected expression, found `let` statement
457 --> $DIR/disallowed-positions.rs:449:9
458 |
459LL | if (let Some(a) = opt && (let Some(b) = a)) && true {
460 | ^^^
461
462error: expected expression, found `let` statement
463 --> $DIR/disallowed-positions.rs:449:31
464 |
465LL | if (let Some(a) = opt && (let Some(b) = a)) && true {
466 | ^^^
467
468error: expected expression, found `let` statement
469 --> $DIR/disallowed-positions.rs:455:9
470 |
471LL | if (let Some(a) = opt && (true)) && true {
472 | ^^^
473
474error: expected expression, found `let` statement
475 --> $DIR/disallowed-positions.rs:472:22
476 |
477LL | let x = (true && let y = 1);
478 | ^^^
479
480error: expected expression, found `let` statement
481 --> $DIR/disallowed-positions.rs:477:20
482 |
483LL | ([1, 2, 3][let _ = ()])
484 | ^^^
485
486error: expected expression, found `let` statement
487 --> $DIR/disallowed-positions.rs:99:16
488 |
489LL | use_expr!((let 0 = 1 && 0 == 0));
490 | ^^^
491
492error: expected expression, found `let` statement
493 --> $DIR/disallowed-positions.rs:103:16
494 |
495LL | use_expr!((let 0 = 1));
496 | ^^^
497
dc9dc135 498error: `let` expressions are not supported here
5099ac24 499 --> $DIR/disallowed-positions.rs:29:9
dc9dc135 500 |
04454e1e
FG
501LL | if (let 0 = 1) {}
502 | ^^^^^^^^^
503 |
504 = note: only supported directly in conditions of `if` and `while` expressions
505note: `let`s wrapped in parentheses are not supported in a context with let chains
506 --> $DIR/disallowed-positions.rs:29:9
507 |
508LL | if (let 0 = 1) {}
509 | ^^^^^^^^^
510
511error: `let` expressions are not supported here
064997fb 512 --> $DIR/disallowed-positions.rs:33:11
04454e1e
FG
513 |
514LL | if (((let 0 = 1))) {}
515 | ^^^^^^^^^
516 |
517 = note: only supported directly in conditions of `if` and `while` expressions
518note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 519 --> $DIR/disallowed-positions.rs:33:11
04454e1e
FG
520 |
521LL | if (((let 0 = 1))) {}
522 | ^^^^^^^^^
523
524error: `let` expressions are not supported here
064997fb 525 --> $DIR/disallowed-positions.rs:37:9
04454e1e
FG
526 |
527LL | if (let 0 = 1) && true {}
528 | ^^^^^^^^^
529 |
530 = note: only supported directly in conditions of `if` and `while` expressions
531note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 532 --> $DIR/disallowed-positions.rs:37:9
04454e1e
FG
533 |
534LL | if (let 0 = 1) && true {}
535 | ^^^^^^^^^
536
537error: `let` expressions are not supported here
064997fb 538 --> $DIR/disallowed-positions.rs:41:17
04454e1e
FG
539 |
540LL | if true && (let 0 = 1) {}
541 | ^^^^^^^^^
542 |
543 = note: only supported directly in conditions of `if` and `while` expressions
544note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 545 --> $DIR/disallowed-positions.rs:41:17
04454e1e
FG
546 |
547LL | if true && (let 0 = 1) {}
548 | ^^^^^^^^^
549
550error: `let` expressions are not supported here
064997fb 551 --> $DIR/disallowed-positions.rs:45:9
04454e1e
FG
552 |
553LL | if (let 0 = 1) && (let 0 = 1) {}
554 | ^^^^^^^^^
555 |
556 = note: only supported directly in conditions of `if` and `while` expressions
557note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 558 --> $DIR/disallowed-positions.rs:45:9
04454e1e
FG
559 |
560LL | if (let 0 = 1) && (let 0 = 1) {}
561 | ^^^^^^^^^
562
563error: `let` expressions are not supported here
064997fb 564 --> $DIR/disallowed-positions.rs:45:24
04454e1e
FG
565 |
566LL | if (let 0 = 1) && (let 0 = 1) {}
567 | ^^^^^^^^^
568 |
569 = note: only supported directly in conditions of `if` and `while` expressions
570note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 571 --> $DIR/disallowed-positions.rs:45:24
04454e1e
FG
572 |
573LL | if (let 0 = 1) && (let 0 = 1) {}
574 | ^^^^^^^^^
575
576error: `let` expressions are not supported here
064997fb 577 --> $DIR/disallowed-positions.rs:51:35
04454e1e
FG
578 |
579LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
580 | ^^^^^^^^^
581 |
582 = note: only supported directly in conditions of `if` and `while` expressions
583note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 584 --> $DIR/disallowed-positions.rs:51:35
04454e1e
FG
585 |
586LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
587 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
588
589error: `let` expressions are not supported here
064997fb 590 --> $DIR/disallowed-positions.rs:51:48
04454e1e
FG
591 |
592LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
593 | ^^^^^^^^^
594 |
595 = note: only supported directly in conditions of `if` and `while` expressions
596note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 597 --> $DIR/disallowed-positions.rs:51:35
04454e1e
FG
598 |
599LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
600 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
601
602error: `let` expressions are not supported here
064997fb 603 --> $DIR/disallowed-positions.rs:51:61
04454e1e
FG
604 |
605LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
606 | ^^^^^^^^^
607 |
608 = note: only supported directly in conditions of `if` and `while` expressions
609note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 610 --> $DIR/disallowed-positions.rs:51:35
04454e1e
FG
611 |
612LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
613 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
614
615error: `let` expressions are not supported here
064997fb 616 --> $DIR/disallowed-positions.rs:61:12
04454e1e
FG
617 |
618LL | while (let 0 = 1) {}
619 | ^^^^^^^^^
620 |
621 = note: only supported directly in conditions of `if` and `while` expressions
622note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 623 --> $DIR/disallowed-positions.rs:61:12
04454e1e
FG
624 |
625LL | while (let 0 = 1) {}
626 | ^^^^^^^^^
627
628error: `let` expressions are not supported here
064997fb 629 --> $DIR/disallowed-positions.rs:65:14
04454e1e
FG
630 |
631LL | while (((let 0 = 1))) {}
632 | ^^^^^^^^^
633 |
634 = note: only supported directly in conditions of `if` and `while` expressions
635note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 636 --> $DIR/disallowed-positions.rs:65:14
04454e1e
FG
637 |
638LL | while (((let 0 = 1))) {}
639 | ^^^^^^^^^
640
641error: `let` expressions are not supported here
064997fb 642 --> $DIR/disallowed-positions.rs:69:12
04454e1e
FG
643 |
644LL | while (let 0 = 1) && true {}
645 | ^^^^^^^^^
646 |
647 = note: only supported directly in conditions of `if` and `while` expressions
648note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 649 --> $DIR/disallowed-positions.rs:69:12
04454e1e
FG
650 |
651LL | while (let 0 = 1) && true {}
652 | ^^^^^^^^^
653
654error: `let` expressions are not supported here
064997fb 655 --> $DIR/disallowed-positions.rs:73:20
04454e1e
FG
656 |
657LL | while true && (let 0 = 1) {}
658 | ^^^^^^^^^
659 |
660 = note: only supported directly in conditions of `if` and `while` expressions
661note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 662 --> $DIR/disallowed-positions.rs:73:20
04454e1e
FG
663 |
664LL | while true && (let 0 = 1) {}
665 | ^^^^^^^^^
666
667error: `let` expressions are not supported here
064997fb 668 --> $DIR/disallowed-positions.rs:77:12
04454e1e
FG
669 |
670LL | while (let 0 = 1) && (let 0 = 1) {}
671 | ^^^^^^^^^
672 |
673 = note: only supported directly in conditions of `if` and `while` expressions
674note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 675 --> $DIR/disallowed-positions.rs:77:12
04454e1e
FG
676 |
677LL | while (let 0 = 1) && (let 0 = 1) {}
678 | ^^^^^^^^^
679
680error: `let` expressions are not supported here
064997fb 681 --> $DIR/disallowed-positions.rs:77:27
04454e1e
FG
682 |
683LL | while (let 0 = 1) && (let 0 = 1) {}
684 | ^^^^^^^^^
685 |
686 = note: only supported directly in conditions of `if` and `while` expressions
687note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 688 --> $DIR/disallowed-positions.rs:77:27
04454e1e
FG
689 |
690LL | while (let 0 = 1) && (let 0 = 1) {}
691 | ^^^^^^^^^
692
693error: `let` expressions are not supported here
064997fb 694 --> $DIR/disallowed-positions.rs:83:38
04454e1e
FG
695 |
696LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
697 | ^^^^^^^^^
698 |
699 = note: only supported directly in conditions of `if` and `while` expressions
700note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 701 --> $DIR/disallowed-positions.rs:83:38
04454e1e
FG
702 |
703LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
704 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
705
706error: `let` expressions are not supported here
064997fb 707 --> $DIR/disallowed-positions.rs:83:51
04454e1e
FG
708 |
709LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
710 | ^^^^^^^^^
711 |
712 = note: only supported directly in conditions of `if` and `while` expressions
713note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 714 --> $DIR/disallowed-positions.rs:83:38
04454e1e
FG
715 |
716LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
717 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
718
719error: `let` expressions are not supported here
064997fb 720 --> $DIR/disallowed-positions.rs:83:64
04454e1e
FG
721 |
722LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
723 | ^^^^^^^^^
724 |
725 = note: only supported directly in conditions of `if` and `while` expressions
726note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 727 --> $DIR/disallowed-positions.rs:83:38
04454e1e
FG
728 |
729LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
730 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
731
732error: `let` expressions are not supported here
064997fb 733 --> $DIR/disallowed-positions.rs:99:16
04454e1e
FG
734 |
735LL | use_expr!((let 0 = 1 && 0 == 0));
736 | ^^^^^^^^^
737 |
738 = note: only supported directly in conditions of `if` and `while` expressions
739note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 740 --> $DIR/disallowed-positions.rs:99:16
04454e1e
FG
741 |
742LL | use_expr!((let 0 = 1 && 0 == 0));
743 | ^^^^^^^^^^^^^^^^^^^
744
745error: `let` expressions are not supported here
064997fb 746 --> $DIR/disallowed-positions.rs:99:16
04454e1e
FG
747 |
748LL | use_expr!((let 0 = 1 && 0 == 0));
749 | ^^^^^^^^^
750 |
751 = note: only supported directly in conditions of `if` and `while` expressions
752note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 753 --> $DIR/disallowed-positions.rs:99:16
04454e1e
FG
754 |
755LL | use_expr!((let 0 = 1 && 0 == 0));
756 | ^^^^^^^^^^^^^^^^^^^
757
758error: `let` expressions are not supported here
064997fb 759 --> $DIR/disallowed-positions.rs:103:16
04454e1e
FG
760 |
761LL | use_expr!((let 0 = 1));
762 | ^^^^^^^^^
763 |
764 = note: only supported directly in conditions of `if` and `while` expressions
765note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 766 --> $DIR/disallowed-positions.rs:103:16
04454e1e
FG
767 |
768LL | use_expr!((let 0 = 1));
769 | ^^^^^^^^^
770
771error: `let` expressions are not supported here
064997fb 772 --> $DIR/disallowed-positions.rs:103:16
04454e1e
FG
773 |
774LL | use_expr!((let 0 = 1));
775 | ^^^^^^^^^
776 |
777 = note: only supported directly in conditions of `if` and `while` expressions
778note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 779 --> $DIR/disallowed-positions.rs:103:16
04454e1e
FG
780 |
781LL | use_expr!((let 0 = 1));
782 | ^^^^^^^^^
783
784error: `let` expressions are not supported here
064997fb 785 --> $DIR/disallowed-positions.rs:110:9
04454e1e 786 |
dc9dc135
XL
787LL | if &let 0 = 0 {}
788 | ^^^^^^^^^
789 |
5e7ed085 790 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
791
792error: `let` expressions are not supported here
064997fb 793 --> $DIR/disallowed-positions.rs:115:9
dc9dc135
XL
794 |
795LL | if !let 0 = 0 {}
796 | ^^^^^^^^^
797 |
5e7ed085 798 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
799
800error: `let` expressions are not supported here
064997fb 801 --> $DIR/disallowed-positions.rs:118:9
dc9dc135
XL
802 |
803LL | if *let 0 = 0 {}
804 | ^^^^^^^^^
805 |
5e7ed085 806 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
807
808error: `let` expressions are not supported here
064997fb 809 --> $DIR/disallowed-positions.rs:122:9
dc9dc135
XL
810 |
811LL | if -let 0 = 0 {}
812 | ^^^^^^^^^
813 |
5e7ed085 814 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
815
816error: `let` expressions are not supported here
064997fb 817 --> $DIR/disallowed-positions.rs:132:9
dc9dc135
XL
818 |
819LL | if (let 0 = 0)? {}
820 | ^^^^^^^^^
821 |
5e7ed085 822 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 823note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 824 --> $DIR/disallowed-positions.rs:132:9
04454e1e
FG
825 |
826LL | if (let 0 = 0)? {}
827 | ^^^^^^^^^
dc9dc135
XL
828
829error: `let` expressions are not supported here
064997fb 830 --> $DIR/disallowed-positions.rs:138:16
dc9dc135
XL
831 |
832LL | if true || let 0 = 0 {}
833 | ^^^^^^^^^
834 |
5e7ed085 835 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 836note: `||` operators are not supported in let chain expressions
064997fb 837 --> $DIR/disallowed-positions.rs:138:13
5e7ed085
FG
838 |
839LL | if true || let 0 = 0 {}
840 | ^^
dc9dc135
XL
841
842error: `let` expressions are not supported here
064997fb 843 --> $DIR/disallowed-positions.rs:141:17
dc9dc135
XL
844 |
845LL | if (true || let 0 = 0) {}
846 | ^^^^^^^^^
847 |
5e7ed085 848 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 849note: `||` operators are not supported in let chain expressions
064997fb 850 --> $DIR/disallowed-positions.rs:141:14
5e7ed085
FG
851 |
852LL | if (true || let 0 = 0) {}
853 | ^^
dc9dc135
XL
854
855error: `let` expressions are not supported here
064997fb 856 --> $DIR/disallowed-positions.rs:144:25
dc9dc135
XL
857 |
858LL | if true && (true || let 0 = 0) {}
859 | ^^^^^^^^^
860 |
5e7ed085 861 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 862note: `||` operators are not supported in let chain expressions
064997fb 863 --> $DIR/disallowed-positions.rs:144:22
5e7ed085
FG
864 |
865LL | if true && (true || let 0 = 0) {}
866 | ^^
dc9dc135
XL
867
868error: `let` expressions are not supported here
064997fb 869 --> $DIR/disallowed-positions.rs:147:25
dc9dc135
XL
870 |
871LL | if true || (true && let 0 = 0) {}
872 | ^^^^^^^^^
873 |
5e7ed085 874 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 875note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 876 --> $DIR/disallowed-positions.rs:147:17
5e7ed085
FG
877 |
878LL | if true || (true && let 0 = 0) {}
04454e1e 879 | ^^^^^^^^^^^^^^^^^
dc9dc135
XL
880
881error: `let` expressions are not supported here
064997fb 882 --> $DIR/disallowed-positions.rs:152:12
dc9dc135
XL
883 |
884LL | if x = let 0 = 0 {}
885 | ^^^^^^^^^
886 |
5e7ed085 887 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
888
889error: `let` expressions are not supported here
064997fb 890 --> $DIR/disallowed-positions.rs:157:15
dc9dc135
XL
891 |
892LL | if true..(let 0 = 0) {}
893 | ^^^^^^^^^
894 |
5e7ed085 895 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 896note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 897 --> $DIR/disallowed-positions.rs:157:15
04454e1e
FG
898 |
899LL | if true..(let 0 = 0) {}
900 | ^^^^^^^^^
dc9dc135
XL
901
902error: `let` expressions are not supported here
064997fb 903 --> $DIR/disallowed-positions.rs:161:11
dc9dc135
XL
904 |
905LL | if ..(let 0 = 0) {}
906 | ^^^^^^^^^
907 |
5e7ed085 908 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 909note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 910 --> $DIR/disallowed-positions.rs:161:11
04454e1e
FG
911 |
912LL | if ..(let 0 = 0) {}
913 | ^^^^^^^^^
dc9dc135
XL
914
915error: `let` expressions are not supported here
064997fb 916 --> $DIR/disallowed-positions.rs:165:9
dc9dc135
XL
917 |
918LL | if (let 0 = 0).. {}
919 | ^^^^^^^^^
920 |
5e7ed085 921 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 922note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 923 --> $DIR/disallowed-positions.rs:165:9
04454e1e
FG
924 |
925LL | if (let 0 = 0).. {}
926 | ^^^^^^^^^
dc9dc135
XL
927
928error: `let` expressions are not supported here
064997fb 929 --> $DIR/disallowed-positions.rs:171:8
dc9dc135
XL
930 |
931LL | if let Range { start: _, end: _ } = true..true && false {}
932 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
933 |
5e7ed085 934 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
935
936error: `let` expressions are not supported here
064997fb 937 --> $DIR/disallowed-positions.rs:175:8
dc9dc135
XL
938 |
939LL | if let Range { start: _, end: _ } = true..true || false {}
940 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
941 |
5e7ed085 942 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
943
944error: `let` expressions are not supported here
064997fb 945 --> $DIR/disallowed-positions.rs:182:8
dc9dc135
XL
946 |
947LL | if let Range { start: F, end } = F..|| true {}
948 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
949 |
5e7ed085 950 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
951
952error: `let` expressions are not supported here
064997fb 953 --> $DIR/disallowed-positions.rs:190:8
dc9dc135
XL
954 |
955LL | if let Range { start: true, end } = t..&&false {}
956 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
957 |
5e7ed085 958 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
959
960error: `let` expressions are not supported here
064997fb 961 --> $DIR/disallowed-positions.rs:196:19
dc9dc135
XL
962 |
963LL | if let true = let true = true {}
964 | ^^^^^^^^^^^^^^^
965 |
5e7ed085 966 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
967
968error: `let` expressions are not supported here
064997fb 969 --> $DIR/disallowed-positions.rs:202:12
dc9dc135
XL
970 |
971LL | while &let 0 = 0 {}
972 | ^^^^^^^^^
973 |
5e7ed085 974 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
975
976error: `let` expressions are not supported here
064997fb 977 --> $DIR/disallowed-positions.rs:207:12
dc9dc135
XL
978 |
979LL | while !let 0 = 0 {}
980 | ^^^^^^^^^
981 |
5e7ed085 982 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
983
984error: `let` expressions are not supported here
064997fb 985 --> $DIR/disallowed-positions.rs:210:12
dc9dc135
XL
986 |
987LL | while *let 0 = 0 {}
988 | ^^^^^^^^^
989 |
5e7ed085 990 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
991
992error: `let` expressions are not supported here
064997fb 993 --> $DIR/disallowed-positions.rs:214:12
dc9dc135
XL
994 |
995LL | while -let 0 = 0 {}
996 | ^^^^^^^^^
997 |
5e7ed085 998 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
999
1000error: `let` expressions are not supported here
064997fb 1001 --> $DIR/disallowed-positions.rs:224:12
dc9dc135
XL
1002 |
1003LL | while (let 0 = 0)? {}
1004 | ^^^^^^^^^
1005 |
5e7ed085 1006 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 1007note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 1008 --> $DIR/disallowed-positions.rs:224:12
04454e1e
FG
1009 |
1010LL | while (let 0 = 0)? {}
1011 | ^^^^^^^^^
dc9dc135
XL
1012
1013error: `let` expressions are not supported here
064997fb 1014 --> $DIR/disallowed-positions.rs:230:19
dc9dc135
XL
1015 |
1016LL | while true || let 0 = 0 {}
1017 | ^^^^^^^^^
1018 |
5e7ed085 1019 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 1020note: `||` operators are not supported in let chain expressions
064997fb 1021 --> $DIR/disallowed-positions.rs:230:16
5e7ed085
FG
1022 |
1023LL | while true || let 0 = 0 {}
1024 | ^^
dc9dc135
XL
1025
1026error: `let` expressions are not supported here
064997fb 1027 --> $DIR/disallowed-positions.rs:233:20
dc9dc135
XL
1028 |
1029LL | while (true || let 0 = 0) {}
1030 | ^^^^^^^^^
1031 |
5e7ed085 1032 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 1033note: `||` operators are not supported in let chain expressions
064997fb 1034 --> $DIR/disallowed-positions.rs:233:17
5e7ed085
FG
1035 |
1036LL | while (true || let 0 = 0) {}
1037 | ^^
dc9dc135
XL
1038
1039error: `let` expressions are not supported here
064997fb 1040 --> $DIR/disallowed-positions.rs:236:28
dc9dc135
XL
1041 |
1042LL | while true && (true || let 0 = 0) {}
1043 | ^^^^^^^^^
1044 |
5e7ed085 1045 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 1046note: `||` operators are not supported in let chain expressions
064997fb 1047 --> $DIR/disallowed-positions.rs:236:25
5e7ed085
FG
1048 |
1049LL | while true && (true || let 0 = 0) {}
1050 | ^^
dc9dc135
XL
1051
1052error: `let` expressions are not supported here
064997fb 1053 --> $DIR/disallowed-positions.rs:239:28
dc9dc135
XL
1054 |
1055LL | while true || (true && let 0 = 0) {}
1056 | ^^^^^^^^^
1057 |
5e7ed085 1058 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 1059note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 1060 --> $DIR/disallowed-positions.rs:239:20
5e7ed085
FG
1061 |
1062LL | while true || (true && let 0 = 0) {}
04454e1e 1063 | ^^^^^^^^^^^^^^^^^
dc9dc135
XL
1064
1065error: `let` expressions are not supported here
064997fb 1066 --> $DIR/disallowed-positions.rs:244:15
dc9dc135
XL
1067 |
1068LL | while x = let 0 = 0 {}
1069 | ^^^^^^^^^
1070 |
5e7ed085 1071 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
1072
1073error: `let` expressions are not supported here
064997fb 1074 --> $DIR/disallowed-positions.rs:249:18
dc9dc135
XL
1075 |
1076LL | while true..(let 0 = 0) {}
1077 | ^^^^^^^^^
1078 |
5e7ed085 1079 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 1080note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 1081 --> $DIR/disallowed-positions.rs:249:18
04454e1e
FG
1082 |
1083LL | while true..(let 0 = 0) {}
1084 | ^^^^^^^^^
dc9dc135
XL
1085
1086error: `let` expressions are not supported here
064997fb 1087 --> $DIR/disallowed-positions.rs:253:14
dc9dc135
XL
1088 |
1089LL | while ..(let 0 = 0) {}
1090 | ^^^^^^^^^
1091 |
5e7ed085 1092 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 1093note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 1094 --> $DIR/disallowed-positions.rs:253:14
04454e1e
FG
1095 |
1096LL | while ..(let 0 = 0) {}
1097 | ^^^^^^^^^
dc9dc135
XL
1098
1099error: `let` expressions are not supported here
064997fb 1100 --> $DIR/disallowed-positions.rs:257:12
dc9dc135
XL
1101 |
1102LL | while (let 0 = 0).. {}
1103 | ^^^^^^^^^
1104 |
5e7ed085 1105 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 1106note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 1107 --> $DIR/disallowed-positions.rs:257:12
04454e1e
FG
1108 |
1109LL | while (let 0 = 0).. {}
1110 | ^^^^^^^^^
dc9dc135
XL
1111
1112error: `let` expressions are not supported here
064997fb 1113 --> $DIR/disallowed-positions.rs:263:11
dc9dc135
XL
1114 |
1115LL | while let Range { start: _, end: _ } = true..true && false {}
1116 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1117 |
5e7ed085 1118 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
1119
1120error: `let` expressions are not supported here
064997fb 1121 --> $DIR/disallowed-positions.rs:267:11
dc9dc135
XL
1122 |
1123LL | while let Range { start: _, end: _ } = true..true || false {}
1124 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1125 |
5e7ed085 1126 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
1127
1128error: `let` expressions are not supported here
064997fb 1129 --> $DIR/disallowed-positions.rs:274:11
dc9dc135
XL
1130 |
1131LL | while let Range { start: F, end } = F..|| true {}
1132 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1133 |
5e7ed085 1134 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
1135
1136error: `let` expressions are not supported here
064997fb 1137 --> $DIR/disallowed-positions.rs:282:11
dc9dc135
XL
1138 |
1139LL | while let Range { start: true, end } = t..&&false {}
1140 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1141 |
5e7ed085 1142 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
1143
1144error: `let` expressions are not supported here
064997fb 1145 --> $DIR/disallowed-positions.rs:288:22
dc9dc135
XL
1146 |
1147LL | while let true = let true = true {}
1148 | ^^^^^^^^^^^^^^^
1149 |
5e7ed085 1150 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
1151
1152error: `let` expressions are not supported here
064997fb 1153 --> $DIR/disallowed-positions.rs:304:6
dc9dc135
XL
1154 |
1155LL | &let 0 = 0;
1156 | ^^^^^^^^^
1157 |
5e7ed085 1158 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
1159
1160error: `let` expressions are not supported here
064997fb 1161 --> $DIR/disallowed-positions.rs:308:6
dc9dc135
XL
1162 |
1163LL | !let 0 = 0;
1164 | ^^^^^^^^^
1165 |
5e7ed085 1166 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
1167
1168error: `let` expressions are not supported here
064997fb 1169 --> $DIR/disallowed-positions.rs:311:6
dc9dc135
XL
1170 |
1171LL | *let 0 = 0;
1172 | ^^^^^^^^^
1173 |
5e7ed085 1174 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
1175
1176error: `let` expressions are not supported here
064997fb 1177 --> $DIR/disallowed-positions.rs:315:6
dc9dc135
XL
1178 |
1179LL | -let 0 = 0;
1180 | ^^^^^^^^^
1181 |
5e7ed085 1182 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
1183
1184error: `let` expressions are not supported here
064997fb 1185 --> $DIR/disallowed-positions.rs:325:6
dc9dc135
XL
1186 |
1187LL | (let 0 = 0)?;
1188 | ^^^^^^^^^
1189 |
5e7ed085 1190 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 1191note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 1192 --> $DIR/disallowed-positions.rs:325:6
04454e1e
FG
1193 |
1194LL | (let 0 = 0)?;
1195 | ^^^^^^^^^
dc9dc135
XL
1196
1197error: `let` expressions are not supported here
064997fb 1198 --> $DIR/disallowed-positions.rs:331:13
dc9dc135
XL
1199 |
1200LL | true || let 0 = 0;
1201 | ^^^^^^^^^
1202 |
5e7ed085 1203 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 1204note: `||` operators are not supported in let chain expressions
064997fb 1205 --> $DIR/disallowed-positions.rs:331:10
5e7ed085
FG
1206 |
1207LL | true || let 0 = 0;
1208 | ^^
dc9dc135
XL
1209
1210error: `let` expressions are not supported here
064997fb 1211 --> $DIR/disallowed-positions.rs:334:14
dc9dc135
XL
1212 |
1213LL | (true || let 0 = 0);
1214 | ^^^^^^^^^
1215 |
5e7ed085 1216 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 1217note: `||` operators are not supported in let chain expressions
064997fb 1218 --> $DIR/disallowed-positions.rs:334:11
5e7ed085
FG
1219 |
1220LL | (true || let 0 = 0);
1221 | ^^
dc9dc135
XL
1222
1223error: `let` expressions are not supported here
064997fb 1224 --> $DIR/disallowed-positions.rs:337:22
dc9dc135
XL
1225 |
1226LL | true && (true || let 0 = 0);
1227 | ^^^^^^^^^
1228 |
5e7ed085 1229 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 1230note: `||` operators are not supported in let chain expressions
064997fb 1231 --> $DIR/disallowed-positions.rs:337:19
5e7ed085
FG
1232 |
1233LL | true && (true || let 0 = 0);
1234 | ^^
dc9dc135
XL
1235
1236error: `let` expressions are not supported here
064997fb 1237 --> $DIR/disallowed-positions.rs:342:9
dc9dc135
XL
1238 |
1239LL | x = let 0 = 0;
1240 | ^^^^^^^^^
1241 |
5e7ed085 1242 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
1243
1244error: `let` expressions are not supported here
064997fb 1245 --> $DIR/disallowed-positions.rs:346:12
dc9dc135
XL
1246 |
1247LL | true..(let 0 = 0);
1248 | ^^^^^^^^^
1249 |
5e7ed085 1250 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 1251note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 1252 --> $DIR/disallowed-positions.rs:346:12
04454e1e
FG
1253 |
1254LL | true..(let 0 = 0);
1255 | ^^^^^^^^^
dc9dc135
XL
1256
1257error: `let` expressions are not supported here
064997fb 1258 --> $DIR/disallowed-positions.rs:349:8
dc9dc135
XL
1259 |
1260LL | ..(let 0 = 0);
1261 | ^^^^^^^^^
1262 |
5e7ed085 1263 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 1264note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 1265 --> $DIR/disallowed-positions.rs:349:8
04454e1e
FG
1266 |
1267LL | ..(let 0 = 0);
1268 | ^^^^^^^^^
dc9dc135
XL
1269
1270error: `let` expressions are not supported here
064997fb 1271 --> $DIR/disallowed-positions.rs:352:6
dc9dc135
XL
1272 |
1273LL | (let 0 = 0)..;
1274 | ^^^^^^^^^
1275 |
5e7ed085 1276 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 1277note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 1278 --> $DIR/disallowed-positions.rs:352:6
04454e1e
FG
1279 |
1280LL | (let 0 = 0)..;
1281 | ^^^^^^^^^
dc9dc135
XL
1282
1283error: `let` expressions are not supported here
064997fb 1284 --> $DIR/disallowed-positions.rs:356:6
dc9dc135
XL
1285 |
1286LL | (let Range { start: _, end: _ } = true..true || false);
1287 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1288 |
5e7ed085 1289 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
1290
1291error: `let` expressions are not supported here
064997fb 1292 --> $DIR/disallowed-positions.rs:361:6
dc9dc135
XL
1293 |
1294LL | (let true = let true = true);
1295 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
1296 |
5e7ed085 1297 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e 1298note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 1299 --> $DIR/disallowed-positions.rs:361:6
04454e1e
FG
1300 |
1301LL | (let true = let true = true);
1302 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
dc9dc135
XL
1303
1304error: `let` expressions are not supported here
064997fb 1305 --> $DIR/disallowed-positions.rs:379:6
dc9dc135
XL
1306 |
1307LL | &let 0 = 0
1308 | ^^^^^^^^^
1309 |
5e7ed085 1310 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
1311
1312error: `let` expressions are not supported here
064997fb 1313 --> $DIR/disallowed-positions.rs:391:17
dc9dc135
XL
1314 |
1315LL | true && let 1 = 1
1316 | ^^^^^^^^^
1317 |
5e7ed085 1318 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
1319
1320error: `let` expressions are not supported here
064997fb 1321 --> $DIR/disallowed-positions.rs:397:17
dc9dc135
XL
1322 |
1323LL | true && let 1 = 1
1324 | ^^^^^^^^^
1325 |
5e7ed085 1326 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135
XL
1327
1328error: `let` expressions are not supported here
064997fb 1329 --> $DIR/disallowed-positions.rs:403:17
dc9dc135
XL
1330 |
1331LL | true && let 1 = 1
1332 | ^^^^^^^^^
1333 |
5e7ed085 1334 = note: only supported directly in conditions of `if` and `while` expressions
dc9dc135 1335
29967ef6 1336error: `let` expressions are not supported here
064997fb 1337 --> $DIR/disallowed-positions.rs:415:17
29967ef6
XL
1338 |
1339LL | true && let 1 = 1
1340 | ^^^^^^^^^
1341 |
5e7ed085 1342 = note: only supported directly in conditions of `if` and `while` expressions
04454e1e
FG
1343
1344error: `let` expressions are not supported here
064997fb 1345 --> $DIR/disallowed-positions.rs:425:9
04454e1e
FG
1346 |
1347LL | if (let Some(a) = opt && true) {
1348 | ^^^^^^^^^^^^^^^^^
1349 |
1350 = note: only supported directly in conditions of `if` and `while` expressions
1351note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 1352 --> $DIR/disallowed-positions.rs:425:9
04454e1e
FG
1353 |
1354LL | if (let Some(a) = opt && true) {
1355 | ^^^^^^^^^^^^^^^^^^^^^^^^^
1356
1357error: `let` expressions are not supported here
064997fb 1358 --> $DIR/disallowed-positions.rs:430:9
04454e1e
FG
1359 |
1360LL | if (let Some(a) = opt) && true {
1361 | ^^^^^^^^^^^^^^^^^
1362 |
1363 = note: only supported directly in conditions of `if` and `while` expressions
1364note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 1365 --> $DIR/disallowed-positions.rs:430:9
04454e1e
FG
1366 |
1367LL | if (let Some(a) = opt) && true {
1368 | ^^^^^^^^^^^^^^^^^
1369
1370error: `let` expressions are not supported here
064997fb 1371 --> $DIR/disallowed-positions.rs:434:9
04454e1e
FG
1372 |
1373LL | if (let Some(a) = opt) && (let Some(b) = a) {
1374 | ^^^^^^^^^^^^^^^^^
1375 |
1376 = note: only supported directly in conditions of `if` and `while` expressions
1377note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 1378 --> $DIR/disallowed-positions.rs:434:9
04454e1e
FG
1379 |
1380LL | if (let Some(a) = opt) && (let Some(b) = a) {
1381 | ^^^^^^^^^^^^^^^^^
1382
1383error: `let` expressions are not supported here
064997fb 1384 --> $DIR/disallowed-positions.rs:434:32
04454e1e
FG
1385 |
1386LL | if (let Some(a) = opt) && (let Some(b) = a) {
1387 | ^^^^^^^^^^^^^^^
1388 |
1389 = note: only supported directly in conditions of `if` and `while` expressions
1390note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 1391 --> $DIR/disallowed-positions.rs:434:32
04454e1e
FG
1392 |
1393LL | if (let Some(a) = opt) && (let Some(b) = a) {
1394 | ^^^^^^^^^^^^^^^
1395
1396error: `let` expressions are not supported here
064997fb 1397 --> $DIR/disallowed-positions.rs:443:9
04454e1e
FG
1398 |
1399LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
1400 | ^^^^^^^^^^^^^^^^^
1401 |
1402 = note: only supported directly in conditions of `if` and `while` expressions
1403note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 1404 --> $DIR/disallowed-positions.rs:443:9
04454e1e
FG
1405 |
1406LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
1407 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1408
1409error: `let` expressions are not supported here
064997fb 1410 --> $DIR/disallowed-positions.rs:443:31
04454e1e
FG
1411 |
1412LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
1413 | ^^^^^^^^^^^^^^^
1414 |
1415 = note: only supported directly in conditions of `if` and `while` expressions
1416note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 1417 --> $DIR/disallowed-positions.rs:443:31
04454e1e
FG
1418 |
1419LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
1420 | ^^^^^^^^^^^^^^^
1421
1422error: `let` expressions are not supported here
064997fb 1423 --> $DIR/disallowed-positions.rs:449:9
04454e1e
FG
1424 |
1425LL | if (let Some(a) = opt && (let Some(b) = a)) && true {
1426 | ^^^^^^^^^^^^^^^^^
1427 |
1428 = note: only supported directly in conditions of `if` and `while` expressions
1429note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 1430 --> $DIR/disallowed-positions.rs:449:9
04454e1e
FG
1431 |
1432LL | if (let Some(a) = opt && (let Some(b) = a)) && true {
1433 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1434
1435error: `let` expressions are not supported here
064997fb 1436 --> $DIR/disallowed-positions.rs:449:31
04454e1e
FG
1437 |
1438LL | if (let Some(a) = opt && (let Some(b) = a)) && true {
1439 | ^^^^^^^^^^^^^^^
1440 |
1441 = note: only supported directly in conditions of `if` and `while` expressions
1442note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 1443 --> $DIR/disallowed-positions.rs:449:31
04454e1e
FG
1444 |
1445LL | if (let Some(a) = opt && (let Some(b) = a)) && true {
1446 | ^^^^^^^^^^^^^^^
1447
1448error: `let` expressions are not supported here
064997fb 1449 --> $DIR/disallowed-positions.rs:455:9
04454e1e
FG
1450 |
1451LL | if (let Some(a) = opt && (true)) && true {
1452 | ^^^^^^^^^^^^^^^^^
1453 |
1454 = note: only supported directly in conditions of `if` and `while` expressions
1455note: `let`s wrapped in parentheses are not supported in a context with let chains
064997fb 1456 --> $DIR/disallowed-positions.rs:455:9
04454e1e
FG
1457 |
1458LL | if (let Some(a) = opt && (true)) && true {
1459 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
416331ca 1460
dc9dc135 1461error[E0308]: mismatched types
064997fb 1462 --> $DIR/disallowed-positions.rs:110:8
dc9dc135
XL
1463 |
1464LL | if &let 0 = 0 {}
94222f64
XL
1465 | ^^^^^^^^^^ expected `bool`, found `&bool`
1466 |
1467help: consider removing the borrow
1468 |
1469LL - if &let 0 = 0 {}
1470LL + if let 0 = 0 {}
923072b8 1471 |
dc9dc135
XL
1472
1473error[E0614]: type `bool` cannot be dereferenced
064997fb 1474 --> $DIR/disallowed-positions.rs:118:8
dc9dc135
XL
1475 |
1476LL | if *let 0 = 0 {}
1477 | ^^^^^^^^^^
1478
1479error[E0600]: cannot apply unary operator `-` to type `bool`
064997fb 1480 --> $DIR/disallowed-positions.rs:122:8
dc9dc135
XL
1481 |
1482LL | if -let 0 = 0 {}
1483 | ^^^^^^^^^^ cannot apply unary operator `-`
dc9dc135 1484
1b1a35ee 1485error[E0277]: the `?` operator can only be applied to values that implement `Try`
064997fb 1486 --> $DIR/disallowed-positions.rs:132:8
dc9dc135
XL
1487 |
1488LL | if (let 0 = 0)? {}
1489 | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
1490 |
1b1a35ee 1491 = help: the trait `Try` is not implemented for `bool`
dc9dc135 1492
17df50a5 1493error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
064997fb 1494 --> $DIR/disallowed-positions.rs:132:19
dc9dc135 1495 |
f2b60f7d
FG
1496LL | fn nested_within_if_expr() {
1497 | -------------------------- this function should return `Result` or `Option` to accept `?`
1498...
1499LL | if (let 0 = 0)? {}
1500 | ^ cannot use the `?` operator in a function that returns `()`
dc9dc135 1501 |
17df50a5 1502 = help: the trait `FromResidual<_>` is not implemented for `()`
dc9dc135
XL
1503
1504error[E0308]: mismatched types
064997fb 1505 --> $DIR/disallowed-positions.rs:152:8
dc9dc135
XL
1506 |
1507LL | if x = let 0 = 0 {}
1b1a35ee
XL
1508 | ^^^^^^^^^^^^^ expected `bool`, found `()`
1509 |
1510help: you might have meant to compare for equality
1511 |
1512LL | if x == let 0 = 0 {}
94222f64 1513 | ~~
dc9dc135
XL
1514
1515error[E0308]: mismatched types
064997fb 1516 --> $DIR/disallowed-positions.rs:157:8
dc9dc135
XL
1517 |
1518LL | if true..(let 0 = 0) {}
60c5eb7d 1519 | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
dc9dc135
XL
1520 |
1521 = note: expected type `bool`
60c5eb7d 1522 found struct `std::ops::Range<bool>`
dc9dc135
XL
1523
1524error[E0308]: mismatched types
064997fb 1525 --> $DIR/disallowed-positions.rs:161:8
dc9dc135
XL
1526 |
1527LL | if ..(let 0 = 0) {}
1b1a35ee 1528 | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeTo`
dc9dc135
XL
1529 |
1530 = note: expected type `bool`
1b1a35ee 1531 found struct `RangeTo<bool>`
dc9dc135
XL
1532
1533error[E0308]: mismatched types
064997fb 1534 --> $DIR/disallowed-positions.rs:165:8
dc9dc135
XL
1535 |
1536LL | if (let 0 = 0).. {}
1b1a35ee 1537 | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeFrom`
dc9dc135
XL
1538 |
1539 = note: expected type `bool`
1b1a35ee 1540 found struct `RangeFrom<bool>`
dc9dc135
XL
1541
1542error[E0308]: mismatched types
064997fb 1543 --> $DIR/disallowed-positions.rs:171:12
dc9dc135
XL
1544 |
1545LL | if let Range { start: _, end: _ } = true..true && false {}
dfeec247 1546 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
dc9dc135 1547 | |
60c5eb7d 1548 | expected `bool`, found struct `std::ops::Range`
dc9dc135
XL
1549 |
1550 = note: expected type `bool`
60c5eb7d 1551 found struct `std::ops::Range<_>`
dc9dc135
XL
1552
1553error[E0308]: mismatched types
064997fb 1554 --> $DIR/disallowed-positions.rs:171:8
dc9dc135
XL
1555 |
1556LL | if let Range { start: _, end: _ } = true..true && false {}
60c5eb7d 1557 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
dc9dc135
XL
1558 |
1559 = note: expected type `bool`
60c5eb7d 1560 found struct `std::ops::Range<bool>`
dc9dc135
XL
1561
1562error[E0308]: mismatched types
064997fb 1563 --> $DIR/disallowed-positions.rs:175:12
dc9dc135
XL
1564 |
1565LL | if let Range { start: _, end: _ } = true..true || false {}
dfeec247 1566 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
dc9dc135 1567 | |
60c5eb7d 1568 | expected `bool`, found struct `std::ops::Range`
dc9dc135
XL
1569 |
1570 = note: expected type `bool`
60c5eb7d 1571 found struct `std::ops::Range<_>`
dc9dc135
XL
1572
1573error[E0308]: mismatched types
064997fb 1574 --> $DIR/disallowed-positions.rs:175:8
dc9dc135
XL
1575 |
1576LL | if let Range { start: _, end: _ } = true..true || false {}
60c5eb7d 1577 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
dc9dc135
XL
1578 |
1579 = note: expected type `bool`
60c5eb7d 1580 found struct `std::ops::Range<bool>`
dc9dc135
XL
1581
1582error[E0308]: mismatched types
064997fb 1583 --> $DIR/disallowed-positions.rs:182:12
dc9dc135
XL
1584 |
1585LL | if let Range { start: F, end } = F..|| true {}
a2a8927a
XL
1586 | ^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `fn() -> bool`
1587 | |
1588 | expected fn pointer, found struct `std::ops::Range`
dc9dc135 1589 |
60c5eb7d
XL
1590 = note: expected fn pointer `fn() -> bool`
1591 found struct `std::ops::Range<_>`
dc9dc135
XL
1592
1593error[E0308]: mismatched types
064997fb 1594 --> $DIR/disallowed-positions.rs:182:41
dc9dc135
XL
1595 |
1596LL | if let Range { start: F, end } = F..|| true {}
60c5eb7d 1597 | ^^^^^^^ expected `bool`, found closure
dc9dc135
XL
1598 |
1599 = note: expected type `bool`
064997fb 1600 found closure `[closure@$DIR/disallowed-positions.rs:182:41: 182:43]`
923072b8
FG
1601help: use parentheses to call this closure
1602 |
1603LL | if let Range { start: F, end } = F..(|| true)() {}
1604 | + +++
dc9dc135
XL
1605
1606error[E0308]: mismatched types
064997fb 1607 --> $DIR/disallowed-positions.rs:182:8
dc9dc135
XL
1608 |
1609LL | if let Range { start: F, end } = F..|| true {}
60c5eb7d 1610 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
dc9dc135
XL
1611 |
1612 = note: expected type `bool`
60c5eb7d 1613 found struct `std::ops::Range<bool>`
dc9dc135
XL
1614
1615error[E0308]: mismatched types
064997fb 1616 --> $DIR/disallowed-positions.rs:190:12
dc9dc135
XL
1617 |
1618LL | if let Range { start: true, end } = t..&&false {}
dfeec247 1619 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool`
dc9dc135 1620 | |
60c5eb7d 1621 | expected `bool`, found struct `std::ops::Range`
dc9dc135
XL
1622 |
1623 = note: expected type `bool`
60c5eb7d 1624 found struct `std::ops::Range<_>`
dc9dc135
XL
1625
1626error[E0308]: mismatched types
064997fb 1627 --> $DIR/disallowed-positions.rs:190:44
dc9dc135
XL
1628 |
1629LL | if let Range { start: true, end } = t..&&false {}
60c5eb7d 1630 | ^^^^^^^ expected `bool`, found `&&bool`
5e7ed085
FG
1631 |
1632help: consider removing the `&&`
1633 |
1634LL - if let Range { start: true, end } = t..&&false {}
1635LL + if let Range { start: true, end } = t..false {}
923072b8 1636 |
dc9dc135
XL
1637
1638error[E0308]: mismatched types
064997fb 1639 --> $DIR/disallowed-positions.rs:190:8
dc9dc135
XL
1640 |
1641LL | if let Range { start: true, end } = t..&&false {}
60c5eb7d 1642 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
dc9dc135
XL
1643 |
1644 = note: expected type `bool`
60c5eb7d 1645 found struct `std::ops::Range<bool>`
dc9dc135 1646
1b1a35ee 1647error[E0277]: the `?` operator can only be applied to values that implement `Try`
064997fb 1648 --> $DIR/disallowed-positions.rs:128:20
dc9dc135
XL
1649 |
1650LL | if let 0 = 0? {}
1651 | ^^ the `?` operator cannot be applied to type `{integer}`
1652 |
1b1a35ee 1653 = help: the trait `Try` is not implemented for `{integer}`
dc9dc135
XL
1654
1655error[E0308]: mismatched types
064997fb 1656 --> $DIR/disallowed-positions.rs:202:11
dc9dc135
XL
1657 |
1658LL | while &let 0 = 0 {}
94222f64
XL
1659 | ^^^^^^^^^^ expected `bool`, found `&bool`
1660 |
1661help: consider removing the borrow
1662 |
1663LL - while &let 0 = 0 {}
1664LL + while let 0 = 0 {}
923072b8 1665 |
dc9dc135
XL
1666
1667error[E0614]: type `bool` cannot be dereferenced
064997fb 1668 --> $DIR/disallowed-positions.rs:210:11
dc9dc135
XL
1669 |
1670LL | while *let 0 = 0 {}
1671 | ^^^^^^^^^^
1672
1673error[E0600]: cannot apply unary operator `-` to type `bool`
064997fb 1674 --> $DIR/disallowed-positions.rs:214:11
dc9dc135
XL
1675 |
1676LL | while -let 0 = 0 {}
1677 | ^^^^^^^^^^ cannot apply unary operator `-`
dc9dc135 1678
1b1a35ee 1679error[E0277]: the `?` operator can only be applied to values that implement `Try`
064997fb 1680 --> $DIR/disallowed-positions.rs:224:11
dc9dc135
XL
1681 |
1682LL | while (let 0 = 0)? {}
1683 | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
1684 |
1b1a35ee 1685 = help: the trait `Try` is not implemented for `bool`
dc9dc135 1686
17df50a5 1687error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
064997fb 1688 --> $DIR/disallowed-positions.rs:224:22
dc9dc135 1689 |
f2b60f7d
FG
1690LL | fn nested_within_while_expr() {
1691 | ----------------------------- this function should return `Result` or `Option` to accept `?`
1692...
1693LL | while (let 0 = 0)? {}
1694 | ^ cannot use the `?` operator in a function that returns `()`
dc9dc135 1695 |
17df50a5 1696 = help: the trait `FromResidual<_>` is not implemented for `()`
dc9dc135
XL
1697
1698error[E0308]: mismatched types
064997fb 1699 --> $DIR/disallowed-positions.rs:244:11
dc9dc135
XL
1700 |
1701LL | while x = let 0 = 0 {}
1b1a35ee
XL
1702 | ^^^^^^^^^^^^^ expected `bool`, found `()`
1703 |
1704help: you might have meant to compare for equality
1705 |
1706LL | while x == let 0 = 0 {}
94222f64 1707 | ~~
dc9dc135
XL
1708
1709error[E0308]: mismatched types
064997fb 1710 --> $DIR/disallowed-positions.rs:249:11
dc9dc135
XL
1711 |
1712LL | while true..(let 0 = 0) {}
60c5eb7d 1713 | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
dc9dc135
XL
1714 |
1715 = note: expected type `bool`
60c5eb7d 1716 found struct `std::ops::Range<bool>`
dc9dc135
XL
1717
1718error[E0308]: mismatched types
064997fb 1719 --> $DIR/disallowed-positions.rs:253:11
dc9dc135
XL
1720 |
1721LL | while ..(let 0 = 0) {}
1b1a35ee 1722 | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeTo`
dc9dc135
XL
1723 |
1724 = note: expected type `bool`
1b1a35ee 1725 found struct `RangeTo<bool>`
dc9dc135
XL
1726
1727error[E0308]: mismatched types
064997fb 1728 --> $DIR/disallowed-positions.rs:257:11
dc9dc135
XL
1729 |
1730LL | while (let 0 = 0).. {}
1b1a35ee 1731 | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeFrom`
dc9dc135
XL
1732 |
1733 = note: expected type `bool`
1b1a35ee 1734 found struct `RangeFrom<bool>`
dc9dc135
XL
1735
1736error[E0308]: mismatched types
064997fb 1737 --> $DIR/disallowed-positions.rs:263:15
dc9dc135
XL
1738 |
1739LL | while let Range { start: _, end: _ } = true..true && false {}
dfeec247 1740 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
dc9dc135 1741 | |
60c5eb7d 1742 | expected `bool`, found struct `std::ops::Range`
dc9dc135
XL
1743 |
1744 = note: expected type `bool`
60c5eb7d 1745 found struct `std::ops::Range<_>`
dc9dc135
XL
1746
1747error[E0308]: mismatched types
064997fb 1748 --> $DIR/disallowed-positions.rs:263:11
dc9dc135
XL
1749 |
1750LL | while let Range { start: _, end: _ } = true..true && false {}
60c5eb7d 1751 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
dc9dc135
XL
1752 |
1753 = note: expected type `bool`
60c5eb7d 1754 found struct `std::ops::Range<bool>`
dc9dc135
XL
1755
1756error[E0308]: mismatched types
064997fb 1757 --> $DIR/disallowed-positions.rs:267:15
dc9dc135
XL
1758 |
1759LL | while let Range { start: _, end: _ } = true..true || false {}
dfeec247 1760 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
dc9dc135 1761 | |
60c5eb7d 1762 | expected `bool`, found struct `std::ops::Range`
dc9dc135
XL
1763 |
1764 = note: expected type `bool`
60c5eb7d 1765 found struct `std::ops::Range<_>`
dc9dc135
XL
1766
1767error[E0308]: mismatched types
064997fb 1768 --> $DIR/disallowed-positions.rs:267:11
dc9dc135
XL
1769 |
1770LL | while let Range { start: _, end: _ } = true..true || false {}
60c5eb7d 1771 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
dc9dc135
XL
1772 |
1773 = note: expected type `bool`
60c5eb7d 1774 found struct `std::ops::Range<bool>`
dc9dc135
XL
1775
1776error[E0308]: mismatched types
064997fb 1777 --> $DIR/disallowed-positions.rs:274:15
dc9dc135
XL
1778 |
1779LL | while let Range { start: F, end } = F..|| true {}
a2a8927a
XL
1780 | ^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `fn() -> bool`
1781 | |
1782 | expected fn pointer, found struct `std::ops::Range`
dc9dc135 1783 |
60c5eb7d
XL
1784 = note: expected fn pointer `fn() -> bool`
1785 found struct `std::ops::Range<_>`
dc9dc135
XL
1786
1787error[E0308]: mismatched types
064997fb 1788 --> $DIR/disallowed-positions.rs:274:44
dc9dc135
XL
1789 |
1790LL | while let Range { start: F, end } = F..|| true {}
60c5eb7d 1791 | ^^^^^^^ expected `bool`, found closure
dc9dc135
XL
1792 |
1793 = note: expected type `bool`
064997fb 1794 found closure `[closure@$DIR/disallowed-positions.rs:274:44: 274:46]`
923072b8
FG
1795help: use parentheses to call this closure
1796 |
1797LL | while let Range { start: F, end } = F..(|| true)() {}
1798 | + +++
dc9dc135
XL
1799
1800error[E0308]: mismatched types
064997fb 1801 --> $DIR/disallowed-positions.rs:274:11
dc9dc135
XL
1802 |
1803LL | while let Range { start: F, end } = F..|| true {}
60c5eb7d 1804 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
dc9dc135
XL
1805 |
1806 = note: expected type `bool`
60c5eb7d 1807 found struct `std::ops::Range<bool>`
dc9dc135
XL
1808
1809error[E0308]: mismatched types
064997fb 1810 --> $DIR/disallowed-positions.rs:282:15
dc9dc135
XL
1811 |
1812LL | while let Range { start: true, end } = t..&&false {}
dfeec247 1813 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool`
dc9dc135 1814 | |
60c5eb7d 1815 | expected `bool`, found struct `std::ops::Range`
dc9dc135
XL
1816 |
1817 = note: expected type `bool`
60c5eb7d 1818 found struct `std::ops::Range<_>`
dc9dc135
XL
1819
1820error[E0308]: mismatched types
064997fb 1821 --> $DIR/disallowed-positions.rs:282:47
dc9dc135
XL
1822 |
1823LL | while let Range { start: true, end } = t..&&false {}
60c5eb7d 1824 | ^^^^^^^ expected `bool`, found `&&bool`
5e7ed085
FG
1825 |
1826help: consider removing the `&&`
1827 |
1828LL - while let Range { start: true, end } = t..&&false {}
1829LL + while let Range { start: true, end } = t..false {}
923072b8 1830 |
dc9dc135
XL
1831
1832error[E0308]: mismatched types
064997fb 1833 --> $DIR/disallowed-positions.rs:282:11
dc9dc135
XL
1834 |
1835LL | while let Range { start: true, end } = t..&&false {}
60c5eb7d 1836 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
dc9dc135
XL
1837 |
1838 = note: expected type `bool`
60c5eb7d 1839 found struct `std::ops::Range<bool>`
dc9dc135 1840
1b1a35ee 1841error[E0277]: the `?` operator can only be applied to values that implement `Try`
064997fb 1842 --> $DIR/disallowed-positions.rs:220:23
dc9dc135
XL
1843 |
1844LL | while let 0 = 0? {}
1845 | ^^ the `?` operator cannot be applied to type `{integer}`
1846 |
1b1a35ee 1847 = help: the trait `Try` is not implemented for `{integer}`
dc9dc135
XL
1848
1849error[E0614]: type `bool` cannot be dereferenced
064997fb 1850 --> $DIR/disallowed-positions.rs:311:5
dc9dc135
XL
1851 |
1852LL | *let 0 = 0;
1853 | ^^^^^^^^^^
1854
1855error[E0600]: cannot apply unary operator `-` to type `bool`
064997fb 1856 --> $DIR/disallowed-positions.rs:315:5
dc9dc135
XL
1857 |
1858LL | -let 0 = 0;
1859 | ^^^^^^^^^^ cannot apply unary operator `-`
dc9dc135 1860
1b1a35ee 1861error[E0277]: the `?` operator can only be applied to values that implement `Try`
064997fb 1862 --> $DIR/disallowed-positions.rs:325:5
dc9dc135
XL
1863 |
1864LL | (let 0 = 0)?;
1865 | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
1866 |
1b1a35ee 1867 = help: the trait `Try` is not implemented for `bool`
dc9dc135 1868
17df50a5 1869error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
064997fb 1870 --> $DIR/disallowed-positions.rs:325:16
dc9dc135 1871 |
f2b60f7d
FG
1872LL | fn outside_if_and_while_expr() {
1873 | ------------------------------ this function should return `Result` or `Option` to accept `?`
1874...
1875LL | (let 0 = 0)?;
1876 | ^ cannot use the `?` operator in a function that returns `()`
dc9dc135 1877 |
17df50a5 1878 = help: the trait `FromResidual<_>` is not implemented for `()`
dc9dc135
XL
1879
1880error[E0308]: mismatched types
064997fb 1881 --> $DIR/disallowed-positions.rs:356:10
dc9dc135
XL
1882 |
1883LL | (let Range { start: _, end: _ } = true..true || false);
dfeec247 1884 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
dc9dc135 1885 | |
60c5eb7d 1886 | expected `bool`, found struct `std::ops::Range`
dc9dc135
XL
1887 |
1888 = note: expected type `bool`
60c5eb7d 1889 found struct `std::ops::Range<_>`
dc9dc135
XL
1890
1891error[E0308]: mismatched types
064997fb 1892 --> $DIR/disallowed-positions.rs:379:5
dc9dc135
XL
1893 |
1894LL | fn outside_if_and_while_expr() {
1895 | - help: try adding a return type: `-> &bool`
1896...
1897LL | &let 0 = 0
60c5eb7d 1898 | ^^^^^^^^^^ expected `()`, found `&bool`
dc9dc135 1899
1b1a35ee 1900error[E0277]: the `?` operator can only be applied to values that implement `Try`
064997fb 1901 --> $DIR/disallowed-positions.rs:321:17
dc9dc135
XL
1902 |
1903LL | let 0 = 0?;
1904 | ^^ the `?` operator cannot be applied to type `{integer}`
1905 |
1b1a35ee 1906 = help: the trait `Try` is not implemented for `{integer}`
dc9dc135 1907
064997fb 1908error: aborting due to 215 previous errors
dc9dc135 1909
f035d41b 1910Some errors have detailed explanations: E0277, E0308, E0600, E0614.
60c5eb7d 1911For more information about an error, try `rustc --explain E0277`.