1 error: expected expression, found `let` statement
2 --> $DIR/disallowed-positions.rs:29:9
7 error: expected expression, found `let` statement
8 --> $DIR/disallowed-positions.rs:33:11
10 LL | if (((let 0 = 1))) {}
13 error: expected expression, found `let` statement
14 --> $DIR/disallowed-positions.rs:37:9
16 LL | if (let 0 = 1) && true {}
19 error: expected expression, found `let` statement
20 --> $DIR/disallowed-positions.rs:41:17
22 LL | if true && (let 0 = 1) {}
25 error: expected expression, found `let` statement
26 --> $DIR/disallowed-positions.rs:45:9
28 LL | if (let 0 = 1) && (let 0 = 1) {}
31 error: expected expression, found `let` statement
32 --> $DIR/disallowed-positions.rs:45:24
34 LL | if (let 0 = 1) && (let 0 = 1) {}
37 error: expected expression, found `let` statement
38 --> $DIR/disallowed-positions.rs:51:35
40 LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
43 error: expected expression, found `let` statement
44 --> $DIR/disallowed-positions.rs:51:48
46 LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
49 error: expected expression, found `let` statement
50 --> $DIR/disallowed-positions.rs:51:61
52 LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
55 error: expected expression, found `let` statement
56 --> $DIR/disallowed-positions.rs:61:12
58 LL | while (let 0 = 1) {}
61 error: expected expression, found `let` statement
62 --> $DIR/disallowed-positions.rs:65:14
64 LL | while (((let 0 = 1))) {}
67 error: expected expression, found `let` statement
68 --> $DIR/disallowed-positions.rs:69:12
70 LL | while (let 0 = 1) && true {}
73 error: expected expression, found `let` statement
74 --> $DIR/disallowed-positions.rs:73:20
76 LL | while true && (let 0 = 1) {}
79 error: expected expression, found `let` statement
80 --> $DIR/disallowed-positions.rs:77:12
82 LL | while (let 0 = 1) && (let 0 = 1) {}
85 error: expected expression, found `let` statement
86 --> $DIR/disallowed-positions.rs:77:27
88 LL | while (let 0 = 1) && (let 0 = 1) {}
91 error: expected expression, found `let` statement
92 --> $DIR/disallowed-positions.rs:83:38
94 LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
97 error: expected expression, found `let` statement
98 --> $DIR/disallowed-positions.rs:83:51
100 LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
103 error: expected expression, found `let` statement
104 --> $DIR/disallowed-positions.rs:83:64
106 LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
109 error: expected expression, found `let` statement
110 --> $DIR/disallowed-positions.rs:110:9
112 LL | if &let 0 = 0 {}
115 error: expected expression, found `let` statement
116 --> $DIR/disallowed-positions.rs:115:9
118 LL | if !let 0 = 0 {}
121 error: expected expression, found `let` statement
122 --> $DIR/disallowed-positions.rs:118:9
124 LL | if *let 0 = 0 {}
127 error: expected expression, found `let` statement
128 --> $DIR/disallowed-positions.rs:122:9
130 LL | if -let 0 = 0 {}
133 error: expected expression, found `let` statement
134 --> $DIR/disallowed-positions.rs:132:9
136 LL | if (let 0 = 0)? {}
139 error: expected expression, found `let` statement
140 --> $DIR/disallowed-positions.rs:138:16
142 LL | if true || let 0 = 0 {}
145 error: expected expression, found `let` statement
146 --> $DIR/disallowed-positions.rs:141:17
148 LL | if (true || let 0 = 0) {}
151 error: expected expression, found `let` statement
152 --> $DIR/disallowed-positions.rs:144:25
154 LL | if true && (true || let 0 = 0) {}
157 error: expected expression, found `let` statement
158 --> $DIR/disallowed-positions.rs:147:25
160 LL | if true || (true && let 0 = 0) {}
163 error: expected expression, found `let` statement
164 --> $DIR/disallowed-positions.rs:152:12
166 LL | if x = let 0 = 0 {}
169 error: expected expression, found `let` statement
170 --> $DIR/disallowed-positions.rs:157:15
172 LL | if true..(let 0 = 0) {}
175 error: expected expression, found `let` statement
176 --> $DIR/disallowed-positions.rs:161:11
178 LL | if ..(let 0 = 0) {}
181 error: expected expression, found `let` statement
182 --> $DIR/disallowed-positions.rs:165:9
184 LL | if (let 0 = 0).. {}
187 error: expected expression, found `let` statement
188 --> $DIR/disallowed-positions.rs:196:19
190 LL | if let true = let true = true {}
193 error: expected expression, found `let` statement
194 --> $DIR/disallowed-positions.rs:202:12
196 LL | while &let 0 = 0 {}
199 error: expected expression, found `let` statement
200 --> $DIR/disallowed-positions.rs:207:12
202 LL | while !let 0 = 0 {}
205 error: expected expression, found `let` statement
206 --> $DIR/disallowed-positions.rs:210:12
208 LL | while *let 0 = 0 {}
211 error: expected expression, found `let` statement
212 --> $DIR/disallowed-positions.rs:214:12
214 LL | while -let 0 = 0 {}
217 error: expected expression, found `let` statement
218 --> $DIR/disallowed-positions.rs:224:12
220 LL | while (let 0 = 0)? {}
223 error: expected expression, found `let` statement
224 --> $DIR/disallowed-positions.rs:230:19
226 LL | while true || let 0 = 0 {}
229 error: expected expression, found `let` statement
230 --> $DIR/disallowed-positions.rs:233:20
232 LL | while (true || let 0 = 0) {}
235 error: expected expression, found `let` statement
236 --> $DIR/disallowed-positions.rs:236:28
238 LL | while true && (true || let 0 = 0) {}
241 error: expected expression, found `let` statement
242 --> $DIR/disallowed-positions.rs:239:28
244 LL | while true || (true && let 0 = 0) {}
247 error: expected expression, found `let` statement
248 --> $DIR/disallowed-positions.rs:244:15
250 LL | while x = let 0 = 0 {}
253 error: expected expression, found `let` statement
254 --> $DIR/disallowed-positions.rs:249:18
256 LL | while true..(let 0 = 0) {}
259 error: expected expression, found `let` statement
260 --> $DIR/disallowed-positions.rs:253:14
262 LL | while ..(let 0 = 0) {}
265 error: expected expression, found `let` statement
266 --> $DIR/disallowed-positions.rs:257:12
268 LL | while (let 0 = 0).. {}
271 error: expected expression, found `let` statement
272 --> $DIR/disallowed-positions.rs:288:22
274 LL | while let true = let true = true {}
277 error: expected expression, found `let` statement
278 --> $DIR/disallowed-positions.rs:304:6
283 error: expected expression, found `let` statement
284 --> $DIR/disallowed-positions.rs:308:6
289 error: expected expression, found `let` statement
290 --> $DIR/disallowed-positions.rs:311:6
295 error: expected expression, found `let` statement
296 --> $DIR/disallowed-positions.rs:315:6
301 error: expected expression, found `let` statement
302 --> $DIR/disallowed-positions.rs:325:6
307 error: expected expression, found `let` statement
308 --> $DIR/disallowed-positions.rs:331:13
310 LL | true || let 0 = 0;
313 error: expected expression, found `let` statement
314 --> $DIR/disallowed-positions.rs:334:14
316 LL | (true || let 0 = 0);
319 error: expected expression, found `let` statement
320 --> $DIR/disallowed-positions.rs:337:22
322 LL | true && (true || let 0 = 0);
325 error: expected expression, found `let` statement
326 --> $DIR/disallowed-positions.rs:342:9
331 error: expected expression, found `let` statement
332 --> $DIR/disallowed-positions.rs:346:12
334 LL | true..(let 0 = 0);
337 error: expected expression, found `let` statement
338 --> $DIR/disallowed-positions.rs:349:8
343 error: expected expression, found `let` statement
344 --> $DIR/disallowed-positions.rs:352:6
349 error: expected expression, found `let` statement
350 --> $DIR/disallowed-positions.rs:356:6
352 LL | (let Range { start: _, end: _ } = true..true || false);
355 error: expected expression, found `let` statement
356 --> $DIR/disallowed-positions.rs:361:6
358 LL | (let true = let true = true);
361 error: expected expression, found `let` statement
362 --> $DIR/disallowed-positions.rs:361:17
364 LL | (let true = let true = true);
367 error: expected expression, found `let` statement
368 --> $DIR/disallowed-positions.rs:368:25
370 LL | let x = true && let y = 1;
373 error: expected expression, found `let` statement
374 --> $DIR/disallowed-positions.rs:374:19
376 LL | [1, 2, 3][let _ = ()]
379 error: expected expression, found `let` statement
380 --> $DIR/disallowed-positions.rs:379:6
385 error: expected expression, found `let` statement
386 --> $DIR/disallowed-positions.rs:391:17
388 LL | true && let 1 = 1
391 error: expected expression, found `let` statement
392 --> $DIR/disallowed-positions.rs:397:17
394 LL | true && let 1 = 1
397 error: expected expression, found `let` statement
398 --> $DIR/disallowed-positions.rs:403:17
400 LL | true && let 1 = 1
403 error: expected expression, found `let` statement
404 --> $DIR/disallowed-positions.rs:415:17
406 LL | true && let 1 = 1
409 error: expressions must be enclosed in braces to be used as const generic arguments
410 --> $DIR/disallowed-positions.rs:415:9
412 LL | true && let 1 = 1
415 help: enclose the `const` expression in braces
417 LL | { true && let 1 = 1 }
420 error: expected expression, found `let` statement
421 --> $DIR/disallowed-positions.rs:425:9
423 LL | if (let Some(a) = opt && true) {
426 error: expected expression, found `let` statement
427 --> $DIR/disallowed-positions.rs:430:9
429 LL | if (let Some(a) = opt) && true {
432 error: expected expression, found `let` statement
433 --> $DIR/disallowed-positions.rs:434:9
435 LL | if (let Some(a) = opt) && (let Some(b) = a) {
438 error: expected expression, found `let` statement
439 --> $DIR/disallowed-positions.rs:434:32
441 LL | if (let Some(a) = opt) && (let Some(b) = a) {
444 error: expected expression, found `let` statement
445 --> $DIR/disallowed-positions.rs:443:9
447 LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
450 error: expected expression, found `let` statement
451 --> $DIR/disallowed-positions.rs:443:31
453 LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
456 error: expected expression, found `let` statement
457 --> $DIR/disallowed-positions.rs:449:9
459 LL | if (let Some(a) = opt && (let Some(b) = a)) && true {
462 error: expected expression, found `let` statement
463 --> $DIR/disallowed-positions.rs:449:31
465 LL | if (let Some(a) = opt && (let Some(b) = a)) && true {
468 error: expected expression, found `let` statement
469 --> $DIR/disallowed-positions.rs:455:9
471 LL | if (let Some(a) = opt && (true)) && true {
474 error: expected expression, found `let` statement
475 --> $DIR/disallowed-positions.rs:472:22
477 LL | let x = (true && let y = 1);
480 error: expected expression, found `let` statement
481 --> $DIR/disallowed-positions.rs:477:20
483 LL | ([1, 2, 3][let _ = ()])
486 error: expected expression, found `let` statement
487 --> $DIR/disallowed-positions.rs:99:16
489 LL | use_expr!((let 0 = 1 && 0 == 0));
492 error: expected expression, found `let` statement
493 --> $DIR/disallowed-positions.rs:103:16
495 LL | use_expr!((let 0 = 1));
498 error: `let` expressions are not supported here
499 --> $DIR/disallowed-positions.rs:29:9
501 LL | if (let 0 = 1) {}
504 = note: only supported directly in conditions of `if` and `while` expressions
505 note: `let`s wrapped in parentheses are not supported in a context with let chains
506 --> $DIR/disallowed-positions.rs:29:9
508 LL | if (let 0 = 1) {}
511 error: `let` expressions are not supported here
512 --> $DIR/disallowed-positions.rs:33:11
514 LL | if (((let 0 = 1))) {}
517 = note: only supported directly in conditions of `if` and `while` expressions
518 note: `let`s wrapped in parentheses are not supported in a context with let chains
519 --> $DIR/disallowed-positions.rs:33:11
521 LL | if (((let 0 = 1))) {}
524 error: `let` expressions are not supported here
525 --> $DIR/disallowed-positions.rs:37:9
527 LL | if (let 0 = 1) && true {}
530 = note: only supported directly in conditions of `if` and `while` expressions
531 note: `let`s wrapped in parentheses are not supported in a context with let chains
532 --> $DIR/disallowed-positions.rs:37:9
534 LL | if (let 0 = 1) && true {}
537 error: `let` expressions are not supported here
538 --> $DIR/disallowed-positions.rs:41:17
540 LL | if true && (let 0 = 1) {}
543 = note: only supported directly in conditions of `if` and `while` expressions
544 note: `let`s wrapped in parentheses are not supported in a context with let chains
545 --> $DIR/disallowed-positions.rs:41:17
547 LL | if true && (let 0 = 1) {}
550 error: `let` expressions are not supported here
551 --> $DIR/disallowed-positions.rs:45:9
553 LL | if (let 0 = 1) && (let 0 = 1) {}
556 = note: only supported directly in conditions of `if` and `while` expressions
557 note: `let`s wrapped in parentheses are not supported in a context with let chains
558 --> $DIR/disallowed-positions.rs:45:9
560 LL | if (let 0 = 1) && (let 0 = 1) {}
563 error: `let` expressions are not supported here
564 --> $DIR/disallowed-positions.rs:45:24
566 LL | if (let 0 = 1) && (let 0 = 1) {}
569 = note: only supported directly in conditions of `if` and `while` expressions
570 note: `let`s wrapped in parentheses are not supported in a context with let chains
571 --> $DIR/disallowed-positions.rs:45:24
573 LL | if (let 0 = 1) && (let 0 = 1) {}
576 error: `let` expressions are not supported here
577 --> $DIR/disallowed-positions.rs:51:35
579 LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
582 = note: only supported directly in conditions of `if` and `while` expressions
583 note: `let`s wrapped in parentheses are not supported in a context with let chains
584 --> $DIR/disallowed-positions.rs:51:35
586 LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
587 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
589 error: `let` expressions are not supported here
590 --> $DIR/disallowed-positions.rs:51:48
592 LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
595 = note: only supported directly in conditions of `if` and `while` expressions
596 note: `let`s wrapped in parentheses are not supported in a context with let chains
597 --> $DIR/disallowed-positions.rs:51:35
599 LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
600 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
602 error: `let` expressions are not supported here
603 --> $DIR/disallowed-positions.rs:51:61
605 LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
608 = note: only supported directly in conditions of `if` and `while` expressions
609 note: `let`s wrapped in parentheses are not supported in a context with let chains
610 --> $DIR/disallowed-positions.rs:51:35
612 LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
613 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
615 error: `let` expressions are not supported here
616 --> $DIR/disallowed-positions.rs:61:12
618 LL | while (let 0 = 1) {}
621 = note: only supported directly in conditions of `if` and `while` expressions
622 note: `let`s wrapped in parentheses are not supported in a context with let chains
623 --> $DIR/disallowed-positions.rs:61:12
625 LL | while (let 0 = 1) {}
628 error: `let` expressions are not supported here
629 --> $DIR/disallowed-positions.rs:65:14
631 LL | while (((let 0 = 1))) {}
634 = note: only supported directly in conditions of `if` and `while` expressions
635 note: `let`s wrapped in parentheses are not supported in a context with let chains
636 --> $DIR/disallowed-positions.rs:65:14
638 LL | while (((let 0 = 1))) {}
641 error: `let` expressions are not supported here
642 --> $DIR/disallowed-positions.rs:69:12
644 LL | while (let 0 = 1) && true {}
647 = note: only supported directly in conditions of `if` and `while` expressions
648 note: `let`s wrapped in parentheses are not supported in a context with let chains
649 --> $DIR/disallowed-positions.rs:69:12
651 LL | while (let 0 = 1) && true {}
654 error: `let` expressions are not supported here
655 --> $DIR/disallowed-positions.rs:73:20
657 LL | while true && (let 0 = 1) {}
660 = note: only supported directly in conditions of `if` and `while` expressions
661 note: `let`s wrapped in parentheses are not supported in a context with let chains
662 --> $DIR/disallowed-positions.rs:73:20
664 LL | while true && (let 0 = 1) {}
667 error: `let` expressions are not supported here
668 --> $DIR/disallowed-positions.rs:77:12
670 LL | while (let 0 = 1) && (let 0 = 1) {}
673 = note: only supported directly in conditions of `if` and `while` expressions
674 note: `let`s wrapped in parentheses are not supported in a context with let chains
675 --> $DIR/disallowed-positions.rs:77:12
677 LL | while (let 0 = 1) && (let 0 = 1) {}
680 error: `let` expressions are not supported here
681 --> $DIR/disallowed-positions.rs:77:27
683 LL | while (let 0 = 1) && (let 0 = 1) {}
686 = note: only supported directly in conditions of `if` and `while` expressions
687 note: `let`s wrapped in parentheses are not supported in a context with let chains
688 --> $DIR/disallowed-positions.rs:77:27
690 LL | while (let 0 = 1) && (let 0 = 1) {}
693 error: `let` expressions are not supported here
694 --> $DIR/disallowed-positions.rs:83:38
696 LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
699 = note: only supported directly in conditions of `if` and `while` expressions
700 note: `let`s wrapped in parentheses are not supported in a context with let chains
701 --> $DIR/disallowed-positions.rs:83:38
703 LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
704 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
706 error: `let` expressions are not supported here
707 --> $DIR/disallowed-positions.rs:83:51
709 LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
712 = note: only supported directly in conditions of `if` and `while` expressions
713 note: `let`s wrapped in parentheses are not supported in a context with let chains
714 --> $DIR/disallowed-positions.rs:83:38
716 LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
717 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
719 error: `let` expressions are not supported here
720 --> $DIR/disallowed-positions.rs:83:64
722 LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
725 = note: only supported directly in conditions of `if` and `while` expressions
726 note: `let`s wrapped in parentheses are not supported in a context with let chains
727 --> $DIR/disallowed-positions.rs:83:38
729 LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
730 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
732 error: `let` expressions are not supported here
733 --> $DIR/disallowed-positions.rs:99:16
735 LL | use_expr!((let 0 = 1 && 0 == 0));
738 = note: only supported directly in conditions of `if` and `while` expressions
739 note: `let`s wrapped in parentheses are not supported in a context with let chains
740 --> $DIR/disallowed-positions.rs:99:16
742 LL | use_expr!((let 0 = 1 && 0 == 0));
743 | ^^^^^^^^^^^^^^^^^^^
745 error: `let` expressions are not supported here
746 --> $DIR/disallowed-positions.rs:99:16
748 LL | use_expr!((let 0 = 1 && 0 == 0));
751 = note: only supported directly in conditions of `if` and `while` expressions
752 note: `let`s wrapped in parentheses are not supported in a context with let chains
753 --> $DIR/disallowed-positions.rs:99:16
755 LL | use_expr!((let 0 = 1 && 0 == 0));
756 | ^^^^^^^^^^^^^^^^^^^
758 error: `let` expressions are not supported here
759 --> $DIR/disallowed-positions.rs:103:16
761 LL | use_expr!((let 0 = 1));
764 = note: only supported directly in conditions of `if` and `while` expressions
765 note: `let`s wrapped in parentheses are not supported in a context with let chains
766 --> $DIR/disallowed-positions.rs:103:16
768 LL | use_expr!((let 0 = 1));
771 error: `let` expressions are not supported here
772 --> $DIR/disallowed-positions.rs:103:16
774 LL | use_expr!((let 0 = 1));
777 = note: only supported directly in conditions of `if` and `while` expressions
778 note: `let`s wrapped in parentheses are not supported in a context with let chains
779 --> $DIR/disallowed-positions.rs:103:16
781 LL | use_expr!((let 0 = 1));
784 error: `let` expressions are not supported here
785 --> $DIR/disallowed-positions.rs:110:9
787 LL | if &let 0 = 0 {}
790 = note: only supported directly in conditions of `if` and `while` expressions
792 error: `let` expressions are not supported here
793 --> $DIR/disallowed-positions.rs:115:9
795 LL | if !let 0 = 0 {}
798 = note: only supported directly in conditions of `if` and `while` expressions
800 error: `let` expressions are not supported here
801 --> $DIR/disallowed-positions.rs:118:9
803 LL | if *let 0 = 0 {}
806 = note: only supported directly in conditions of `if` and `while` expressions
808 error: `let` expressions are not supported here
809 --> $DIR/disallowed-positions.rs:122:9
811 LL | if -let 0 = 0 {}
814 = note: only supported directly in conditions of `if` and `while` expressions
816 error: `let` expressions are not supported here
817 --> $DIR/disallowed-positions.rs:132:9
819 LL | if (let 0 = 0)? {}
822 = note: only supported directly in conditions of `if` and `while` expressions
823 note: `let`s wrapped in parentheses are not supported in a context with let chains
824 --> $DIR/disallowed-positions.rs:132:9
826 LL | if (let 0 = 0)? {}
829 error: `let` expressions are not supported here
830 --> $DIR/disallowed-positions.rs:138:16
832 LL | if true || let 0 = 0 {}
835 = note: only supported directly in conditions of `if` and `while` expressions
836 note: `||` operators are not supported in let chain expressions
837 --> $DIR/disallowed-positions.rs:138:13
839 LL | if true || let 0 = 0 {}
842 error: `let` expressions are not supported here
843 --> $DIR/disallowed-positions.rs:141:17
845 LL | if (true || let 0 = 0) {}
848 = note: only supported directly in conditions of `if` and `while` expressions
849 note: `||` operators are not supported in let chain expressions
850 --> $DIR/disallowed-positions.rs:141:14
852 LL | if (true || let 0 = 0) {}
855 error: `let` expressions are not supported here
856 --> $DIR/disallowed-positions.rs:144:25
858 LL | if true && (true || let 0 = 0) {}
861 = note: only supported directly in conditions of `if` and `while` expressions
862 note: `||` operators are not supported in let chain expressions
863 --> $DIR/disallowed-positions.rs:144:22
865 LL | if true && (true || let 0 = 0) {}
868 error: `let` expressions are not supported here
869 --> $DIR/disallowed-positions.rs:147:25
871 LL | if true || (true && let 0 = 0) {}
874 = note: only supported directly in conditions of `if` and `while` expressions
875 note: `let`s wrapped in parentheses are not supported in a context with let chains
876 --> $DIR/disallowed-positions.rs:147:17
878 LL | if true || (true && let 0 = 0) {}
881 error: `let` expressions are not supported here
882 --> $DIR/disallowed-positions.rs:152:12
884 LL | if x = let 0 = 0 {}
887 = note: only supported directly in conditions of `if` and `while` expressions
889 error: `let` expressions are not supported here
890 --> $DIR/disallowed-positions.rs:157:15
892 LL | if true..(let 0 = 0) {}
895 = note: only supported directly in conditions of `if` and `while` expressions
896 note: `let`s wrapped in parentheses are not supported in a context with let chains
897 --> $DIR/disallowed-positions.rs:157:15
899 LL | if true..(let 0 = 0) {}
902 error: `let` expressions are not supported here
903 --> $DIR/disallowed-positions.rs:161:11
905 LL | if ..(let 0 = 0) {}
908 = note: only supported directly in conditions of `if` and `while` expressions
909 note: `let`s wrapped in parentheses are not supported in a context with let chains
910 --> $DIR/disallowed-positions.rs:161:11
912 LL | if ..(let 0 = 0) {}
915 error: `let` expressions are not supported here
916 --> $DIR/disallowed-positions.rs:165:9
918 LL | if (let 0 = 0).. {}
921 = note: only supported directly in conditions of `if` and `while` expressions
922 note: `let`s wrapped in parentheses are not supported in a context with let chains
923 --> $DIR/disallowed-positions.rs:165:9
925 LL | if (let 0 = 0).. {}
928 error: `let` expressions are not supported here
929 --> $DIR/disallowed-positions.rs:171:8
931 LL | if let Range { start: _, end: _ } = true..true && false {}
932 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
934 = note: only supported directly in conditions of `if` and `while` expressions
936 error: `let` expressions are not supported here
937 --> $DIR/disallowed-positions.rs:175:8
939 LL | if let Range { start: _, end: _ } = true..true || false {}
940 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
942 = note: only supported directly in conditions of `if` and `while` expressions
944 error: `let` expressions are not supported here
945 --> $DIR/disallowed-positions.rs:182:8
947 LL | if let Range { start: F, end } = F..|| true {}
948 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
950 = note: only supported directly in conditions of `if` and `while` expressions
952 error: `let` expressions are not supported here
953 --> $DIR/disallowed-positions.rs:190:8
955 LL | if let Range { start: true, end } = t..&&false {}
956 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
958 = note: only supported directly in conditions of `if` and `while` expressions
960 error: `let` expressions are not supported here
961 --> $DIR/disallowed-positions.rs:196:19
963 LL | if let true = let true = true {}
966 = note: only supported directly in conditions of `if` and `while` expressions
968 error: `let` expressions are not supported here
969 --> $DIR/disallowed-positions.rs:202:12
971 LL | while &let 0 = 0 {}
974 = note: only supported directly in conditions of `if` and `while` expressions
976 error: `let` expressions are not supported here
977 --> $DIR/disallowed-positions.rs:207:12
979 LL | while !let 0 = 0 {}
982 = note: only supported directly in conditions of `if` and `while` expressions
984 error: `let` expressions are not supported here
985 --> $DIR/disallowed-positions.rs:210:12
987 LL | while *let 0 = 0 {}
990 = note: only supported directly in conditions of `if` and `while` expressions
992 error: `let` expressions are not supported here
993 --> $DIR/disallowed-positions.rs:214:12
995 LL | while -let 0 = 0 {}
998 = note: only supported directly in conditions of `if` and `while` expressions
1000 error: `let` expressions are not supported here
1001 --> $DIR/disallowed-positions.rs:224:12
1003 LL | while (let 0 = 0)? {}
1006 = note: only supported directly in conditions of `if` and `while` expressions
1007 note: `let`s wrapped in parentheses are not supported in a context with let chains
1008 --> $DIR/disallowed-positions.rs:224:12
1010 LL | while (let 0 = 0)? {}
1013 error: `let` expressions are not supported here
1014 --> $DIR/disallowed-positions.rs:230:19
1016 LL | while true || let 0 = 0 {}
1019 = note: only supported directly in conditions of `if` and `while` expressions
1020 note: `||` operators are not supported in let chain expressions
1021 --> $DIR/disallowed-positions.rs:230:16
1023 LL | while true || let 0 = 0 {}
1026 error: `let` expressions are not supported here
1027 --> $DIR/disallowed-positions.rs:233:20
1029 LL | while (true || let 0 = 0) {}
1032 = note: only supported directly in conditions of `if` and `while` expressions
1033 note: `||` operators are not supported in let chain expressions
1034 --> $DIR/disallowed-positions.rs:233:17
1036 LL | while (true || let 0 = 0) {}
1039 error: `let` expressions are not supported here
1040 --> $DIR/disallowed-positions.rs:236:28
1042 LL | while true && (true || let 0 = 0) {}
1045 = note: only supported directly in conditions of `if` and `while` expressions
1046 note: `||` operators are not supported in let chain expressions
1047 --> $DIR/disallowed-positions.rs:236:25
1049 LL | while true && (true || let 0 = 0) {}
1052 error: `let` expressions are not supported here
1053 --> $DIR/disallowed-positions.rs:239:28
1055 LL | while true || (true && let 0 = 0) {}
1058 = note: only supported directly in conditions of `if` and `while` expressions
1059 note: `let`s wrapped in parentheses are not supported in a context with let chains
1060 --> $DIR/disallowed-positions.rs:239:20
1062 LL | while true || (true && let 0 = 0) {}
1065 error: `let` expressions are not supported here
1066 --> $DIR/disallowed-positions.rs:244:15
1068 LL | while x = let 0 = 0 {}
1071 = note: only supported directly in conditions of `if` and `while` expressions
1073 error: `let` expressions are not supported here
1074 --> $DIR/disallowed-positions.rs:249:18
1076 LL | while true..(let 0 = 0) {}
1079 = note: only supported directly in conditions of `if` and `while` expressions
1080 note: `let`s wrapped in parentheses are not supported in a context with let chains
1081 --> $DIR/disallowed-positions.rs:249:18
1083 LL | while true..(let 0 = 0) {}
1086 error: `let` expressions are not supported here
1087 --> $DIR/disallowed-positions.rs:253:14
1089 LL | while ..(let 0 = 0) {}
1092 = note: only supported directly in conditions of `if` and `while` expressions
1093 note: `let`s wrapped in parentheses are not supported in a context with let chains
1094 --> $DIR/disallowed-positions.rs:253:14
1096 LL | while ..(let 0 = 0) {}
1099 error: `let` expressions are not supported here
1100 --> $DIR/disallowed-positions.rs:257:12
1102 LL | while (let 0 = 0).. {}
1105 = note: only supported directly in conditions of `if` and `while` expressions
1106 note: `let`s wrapped in parentheses are not supported in a context with let chains
1107 --> $DIR/disallowed-positions.rs:257:12
1109 LL | while (let 0 = 0).. {}
1112 error: `let` expressions are not supported here
1113 --> $DIR/disallowed-positions.rs:263:11
1115 LL | while let Range { start: _, end: _ } = true..true && false {}
1116 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1118 = note: only supported directly in conditions of `if` and `while` expressions
1120 error: `let` expressions are not supported here
1121 --> $DIR/disallowed-positions.rs:267:11
1123 LL | while let Range { start: _, end: _ } = true..true || false {}
1124 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1126 = note: only supported directly in conditions of `if` and `while` expressions
1128 error: `let` expressions are not supported here
1129 --> $DIR/disallowed-positions.rs:274:11
1131 LL | while let Range { start: F, end } = F..|| true {}
1132 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1134 = note: only supported directly in conditions of `if` and `while` expressions
1136 error: `let` expressions are not supported here
1137 --> $DIR/disallowed-positions.rs:282:11
1139 LL | while let Range { start: true, end } = t..&&false {}
1140 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1142 = note: only supported directly in conditions of `if` and `while` expressions
1144 error: `let` expressions are not supported here
1145 --> $DIR/disallowed-positions.rs:288:22
1147 LL | while let true = let true = true {}
1150 = note: only supported directly in conditions of `if` and `while` expressions
1152 error: `let` expressions are not supported here
1153 --> $DIR/disallowed-positions.rs:304:6
1158 = note: only supported directly in conditions of `if` and `while` expressions
1160 error: `let` expressions are not supported here
1161 --> $DIR/disallowed-positions.rs:308:6
1166 = note: only supported directly in conditions of `if` and `while` expressions
1168 error: `let` expressions are not supported here
1169 --> $DIR/disallowed-positions.rs:311:6
1174 = note: only supported directly in conditions of `if` and `while` expressions
1176 error: `let` expressions are not supported here
1177 --> $DIR/disallowed-positions.rs:315:6
1182 = note: only supported directly in conditions of `if` and `while` expressions
1184 error: `let` expressions are not supported here
1185 --> $DIR/disallowed-positions.rs:325:6
1190 = note: only supported directly in conditions of `if` and `while` expressions
1191 note: `let`s wrapped in parentheses are not supported in a context with let chains
1192 --> $DIR/disallowed-positions.rs:325:6
1197 error: `let` expressions are not supported here
1198 --> $DIR/disallowed-positions.rs:331:13
1200 LL | true || let 0 = 0;
1203 = note: only supported directly in conditions of `if` and `while` expressions
1204 note: `||` operators are not supported in let chain expressions
1205 --> $DIR/disallowed-positions.rs:331:10
1207 LL | true || let 0 = 0;
1210 error: `let` expressions are not supported here
1211 --> $DIR/disallowed-positions.rs:334:14
1213 LL | (true || let 0 = 0);
1216 = note: only supported directly in conditions of `if` and `while` expressions
1217 note: `||` operators are not supported in let chain expressions
1218 --> $DIR/disallowed-positions.rs:334:11
1220 LL | (true || let 0 = 0);
1223 error: `let` expressions are not supported here
1224 --> $DIR/disallowed-positions.rs:337:22
1226 LL | true && (true || let 0 = 0);
1229 = note: only supported directly in conditions of `if` and `while` expressions
1230 note: `||` operators are not supported in let chain expressions
1231 --> $DIR/disallowed-positions.rs:337:19
1233 LL | true && (true || let 0 = 0);
1236 error: `let` expressions are not supported here
1237 --> $DIR/disallowed-positions.rs:342:9
1242 = note: only supported directly in conditions of `if` and `while` expressions
1244 error: `let` expressions are not supported here
1245 --> $DIR/disallowed-positions.rs:346:12
1247 LL | true..(let 0 = 0);
1250 = note: only supported directly in conditions of `if` and `while` expressions
1251 note: `let`s wrapped in parentheses are not supported in a context with let chains
1252 --> $DIR/disallowed-positions.rs:346:12
1254 LL | true..(let 0 = 0);
1257 error: `let` expressions are not supported here
1258 --> $DIR/disallowed-positions.rs:349:8
1263 = note: only supported directly in conditions of `if` and `while` expressions
1264 note: `let`s wrapped in parentheses are not supported in a context with let chains
1265 --> $DIR/disallowed-positions.rs:349:8
1270 error: `let` expressions are not supported here
1271 --> $DIR/disallowed-positions.rs:352:6
1276 = note: only supported directly in conditions of `if` and `while` expressions
1277 note: `let`s wrapped in parentheses are not supported in a context with let chains
1278 --> $DIR/disallowed-positions.rs:352:6
1283 error: `let` expressions are not supported here
1284 --> $DIR/disallowed-positions.rs:356:6
1286 LL | (let Range { start: _, end: _ } = true..true || false);
1287 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1289 = note: only supported directly in conditions of `if` and `while` expressions
1291 error: `let` expressions are not supported here
1292 --> $DIR/disallowed-positions.rs:361:6
1294 LL | (let true = let true = true);
1295 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
1297 = note: only supported directly in conditions of `if` and `while` expressions
1298 note: `let`s wrapped in parentheses are not supported in a context with let chains
1299 --> $DIR/disallowed-positions.rs:361:6
1301 LL | (let true = let true = true);
1302 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
1304 error: `let` expressions are not supported here
1305 --> $DIR/disallowed-positions.rs:379:6
1310 = note: only supported directly in conditions of `if` and `while` expressions
1312 error: `let` expressions are not supported here
1313 --> $DIR/disallowed-positions.rs:391:17
1315 LL | true && let 1 = 1
1318 = note: only supported directly in conditions of `if` and `while` expressions
1320 error: `let` expressions are not supported here
1321 --> $DIR/disallowed-positions.rs:397:17
1323 LL | true && let 1 = 1
1326 = note: only supported directly in conditions of `if` and `while` expressions
1328 error: `let` expressions are not supported here
1329 --> $DIR/disallowed-positions.rs:403:17
1331 LL | true && let 1 = 1
1334 = note: only supported directly in conditions of `if` and `while` expressions
1336 error: `let` expressions are not supported here
1337 --> $DIR/disallowed-positions.rs:415:17
1339 LL | true && let 1 = 1
1342 = note: only supported directly in conditions of `if` and `while` expressions
1344 error: `let` expressions are not supported here
1345 --> $DIR/disallowed-positions.rs:425:9
1347 LL | if (let Some(a) = opt && true) {
1350 = note: only supported directly in conditions of `if` and `while` expressions
1351 note: `let`s wrapped in parentheses are not supported in a context with let chains
1352 --> $DIR/disallowed-positions.rs:425:9
1354 LL | if (let Some(a) = opt && true) {
1355 | ^^^^^^^^^^^^^^^^^^^^^^^^^
1357 error: `let` expressions are not supported here
1358 --> $DIR/disallowed-positions.rs:430:9
1360 LL | if (let Some(a) = opt) && true {
1363 = note: only supported directly in conditions of `if` and `while` expressions
1364 note: `let`s wrapped in parentheses are not supported in a context with let chains
1365 --> $DIR/disallowed-positions.rs:430:9
1367 LL | if (let Some(a) = opt) && true {
1370 error: `let` expressions are not supported here
1371 --> $DIR/disallowed-positions.rs:434:9
1373 LL | if (let Some(a) = opt) && (let Some(b) = a) {
1376 = note: only supported directly in conditions of `if` and `while` expressions
1377 note: `let`s wrapped in parentheses are not supported in a context with let chains
1378 --> $DIR/disallowed-positions.rs:434:9
1380 LL | if (let Some(a) = opt) && (let Some(b) = a) {
1383 error: `let` expressions are not supported here
1384 --> $DIR/disallowed-positions.rs:434:32
1386 LL | if (let Some(a) = opt) && (let Some(b) = a) {
1389 = note: only supported directly in conditions of `if` and `while` expressions
1390 note: `let`s wrapped in parentheses are not supported in a context with let chains
1391 --> $DIR/disallowed-positions.rs:434:32
1393 LL | if (let Some(a) = opt) && (let Some(b) = a) {
1396 error: `let` expressions are not supported here
1397 --> $DIR/disallowed-positions.rs:443:9
1399 LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
1402 = note: only supported directly in conditions of `if` and `while` expressions
1403 note: `let`s wrapped in parentheses are not supported in a context with let chains
1404 --> $DIR/disallowed-positions.rs:443:9
1406 LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
1407 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1409 error: `let` expressions are not supported here
1410 --> $DIR/disallowed-positions.rs:443:31
1412 LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
1415 = note: only supported directly in conditions of `if` and `while` expressions
1416 note: `let`s wrapped in parentheses are not supported in a context with let chains
1417 --> $DIR/disallowed-positions.rs:443:31
1419 LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
1422 error: `let` expressions are not supported here
1423 --> $DIR/disallowed-positions.rs:449:9
1425 LL | if (let Some(a) = opt && (let Some(b) = a)) && true {
1428 = note: only supported directly in conditions of `if` and `while` expressions
1429 note: `let`s wrapped in parentheses are not supported in a context with let chains
1430 --> $DIR/disallowed-positions.rs:449:9
1432 LL | if (let Some(a) = opt && (let Some(b) = a)) && true {
1433 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1435 error: `let` expressions are not supported here
1436 --> $DIR/disallowed-positions.rs:449:31
1438 LL | if (let Some(a) = opt && (let Some(b) = a)) && true {
1441 = note: only supported directly in conditions of `if` and `while` expressions
1442 note: `let`s wrapped in parentheses are not supported in a context with let chains
1443 --> $DIR/disallowed-positions.rs:449:31
1445 LL | if (let Some(a) = opt && (let Some(b) = a)) && true {
1448 error: `let` expressions are not supported here
1449 --> $DIR/disallowed-positions.rs:455:9
1451 LL | if (let Some(a) = opt && (true)) && true {
1454 = note: only supported directly in conditions of `if` and `while` expressions
1455 note: `let`s wrapped in parentheses are not supported in a context with let chains
1456 --> $DIR/disallowed-positions.rs:455:9
1458 LL | if (let Some(a) = opt && (true)) && true {
1459 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1461 error[E0308]: mismatched types
1462 --> $DIR/disallowed-positions.rs:110:8
1464 LL | if &let 0 = 0 {}
1465 | ^^^^^^^^^^ expected `bool`, found `&bool`
1467 help: consider removing the borrow
1469 LL - if &let 0 = 0 {}
1470 LL + if let 0 = 0 {}
1473 error[E0614]: type `bool` cannot be dereferenced
1474 --> $DIR/disallowed-positions.rs:118:8
1476 LL | if *let 0 = 0 {}
1479 error[E0600]: cannot apply unary operator `-` to type `bool`
1480 --> $DIR/disallowed-positions.rs:122:8
1482 LL | if -let 0 = 0 {}
1483 | ^^^^^^^^^^ cannot apply unary operator `-`
1485 error[E0277]: the `?` operator can only be applied to values that implement `Try`
1486 --> $DIR/disallowed-positions.rs:132:8
1488 LL | if (let 0 = 0)? {}
1489 | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
1491 = help: the trait `Try` is not implemented for `bool`
1493 error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
1494 --> $DIR/disallowed-positions.rs:132:19
1496 LL | fn nested_within_if_expr() {
1497 | -------------------------- this function should return `Result` or `Option` to accept `?`
1499 LL | if (let 0 = 0)? {}
1500 | ^ cannot use the `?` operator in a function that returns `()`
1502 = help: the trait `FromResidual<_>` is not implemented for `()`
1504 error[E0308]: mismatched types
1505 --> $DIR/disallowed-positions.rs:152:8
1507 LL | if x = let 0 = 0 {}
1508 | ^^^^^^^^^^^^^ expected `bool`, found `()`
1510 help: you might have meant to compare for equality
1512 LL | if x == let 0 = 0 {}
1515 error[E0308]: mismatched types
1516 --> $DIR/disallowed-positions.rs:157:8
1518 LL | if true..(let 0 = 0) {}
1519 | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
1521 = note: expected type `bool`
1522 found struct `std::ops::Range<bool>`
1524 error[E0308]: mismatched types
1525 --> $DIR/disallowed-positions.rs:161:8
1527 LL | if ..(let 0 = 0) {}
1528 | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeTo`
1530 = note: expected type `bool`
1531 found struct `RangeTo<bool>`
1533 error[E0308]: mismatched types
1534 --> $DIR/disallowed-positions.rs:165:8
1536 LL | if (let 0 = 0).. {}
1537 | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeFrom`
1539 = note: expected type `bool`
1540 found struct `RangeFrom<bool>`
1542 error[E0308]: mismatched types
1543 --> $DIR/disallowed-positions.rs:171:12
1545 LL | if let Range { start: _, end: _ } = true..true && false {}
1546 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
1548 | expected `bool`, found struct `Range`
1550 = note: expected type `bool`
1551 found struct `std::ops::Range<_>`
1553 error[E0308]: mismatched types
1554 --> $DIR/disallowed-positions.rs:171:8
1556 LL | if let Range { start: _, end: _ } = true..true && false {}
1557 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
1559 = note: expected type `bool`
1560 found struct `std::ops::Range<bool>`
1562 error[E0308]: mismatched types
1563 --> $DIR/disallowed-positions.rs:175:12
1565 LL | if let Range { start: _, end: _ } = true..true || false {}
1566 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
1568 | expected `bool`, found struct `Range`
1570 = note: expected type `bool`
1571 found struct `std::ops::Range<_>`
1573 error[E0308]: mismatched types
1574 --> $DIR/disallowed-positions.rs:175:8
1576 LL | if let Range { start: _, end: _ } = true..true || false {}
1577 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
1579 = note: expected type `bool`
1580 found struct `std::ops::Range<bool>`
1582 error[E0308]: mismatched types
1583 --> $DIR/disallowed-positions.rs:182:12
1585 LL | if let Range { start: F, end } = F..|| true {}
1586 | ^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `fn() -> bool`
1588 | expected fn pointer, found struct `Range`
1590 = note: expected fn pointer `fn() -> bool`
1591 found struct `std::ops::Range<_>`
1593 error[E0308]: mismatched types
1594 --> $DIR/disallowed-positions.rs:182:41
1596 LL | if let Range { start: F, end } = F..|| true {}
1597 | ^^^^^^^ expected `bool`, found closure
1599 = note: expected type `bool`
1600 found closure `[closure@$DIR/disallowed-positions.rs:182:41: 182:43]`
1601 help: use parentheses to call this closure
1603 LL | if let Range { start: F, end } = F..(|| true)() {}
1606 error[E0308]: mismatched types
1607 --> $DIR/disallowed-positions.rs:182:8
1609 LL | if let Range { start: F, end } = F..|| true {}
1610 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
1612 = note: expected type `bool`
1613 found struct `std::ops::Range<bool>`
1615 error[E0308]: mismatched types
1616 --> $DIR/disallowed-positions.rs:190:12
1618 LL | if let Range { start: true, end } = t..&&false {}
1619 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool`
1621 | expected `bool`, found struct `Range`
1623 = note: expected type `bool`
1624 found struct `std::ops::Range<_>`
1626 error[E0308]: mismatched types
1627 --> $DIR/disallowed-positions.rs:190:44
1629 LL | if let Range { start: true, end } = t..&&false {}
1630 | ^^^^^^^ expected `bool`, found `&&bool`
1632 help: consider removing the `&&`
1634 LL - if let Range { start: true, end } = t..&&false {}
1635 LL + if let Range { start: true, end } = t..false {}
1638 error[E0308]: mismatched types
1639 --> $DIR/disallowed-positions.rs:190:8
1641 LL | if let Range { start: true, end } = t..&&false {}
1642 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
1644 = note: expected type `bool`
1645 found struct `std::ops::Range<bool>`
1647 error[E0277]: the `?` operator can only be applied to values that implement `Try`
1648 --> $DIR/disallowed-positions.rs:128:20
1650 LL | if let 0 = 0? {}
1651 | ^^ the `?` operator cannot be applied to type `{integer}`
1653 = help: the trait `Try` is not implemented for `{integer}`
1655 error[E0308]: mismatched types
1656 --> $DIR/disallowed-positions.rs:202:11
1658 LL | while &let 0 = 0 {}
1659 | ^^^^^^^^^^ expected `bool`, found `&bool`
1661 help: consider removing the borrow
1663 LL - while &let 0 = 0 {}
1664 LL + while let 0 = 0 {}
1667 error[E0614]: type `bool` cannot be dereferenced
1668 --> $DIR/disallowed-positions.rs:210:11
1670 LL | while *let 0 = 0 {}
1673 error[E0600]: cannot apply unary operator `-` to type `bool`
1674 --> $DIR/disallowed-positions.rs:214:11
1676 LL | while -let 0 = 0 {}
1677 | ^^^^^^^^^^ cannot apply unary operator `-`
1679 error[E0277]: the `?` operator can only be applied to values that implement `Try`
1680 --> $DIR/disallowed-positions.rs:224:11
1682 LL | while (let 0 = 0)? {}
1683 | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
1685 = help: the trait `Try` is not implemented for `bool`
1687 error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
1688 --> $DIR/disallowed-positions.rs:224:22
1690 LL | fn nested_within_while_expr() {
1691 | ----------------------------- this function should return `Result` or `Option` to accept `?`
1693 LL | while (let 0 = 0)? {}
1694 | ^ cannot use the `?` operator in a function that returns `()`
1696 = help: the trait `FromResidual<_>` is not implemented for `()`
1698 error[E0308]: mismatched types
1699 --> $DIR/disallowed-positions.rs:244:11
1701 LL | while x = let 0 = 0 {}
1702 | ^^^^^^^^^^^^^ expected `bool`, found `()`
1704 help: you might have meant to compare for equality
1706 LL | while x == let 0 = 0 {}
1709 error[E0308]: mismatched types
1710 --> $DIR/disallowed-positions.rs:249:11
1712 LL | while true..(let 0 = 0) {}
1713 | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
1715 = note: expected type `bool`
1716 found struct `std::ops::Range<bool>`
1718 error[E0308]: mismatched types
1719 --> $DIR/disallowed-positions.rs:253:11
1721 LL | while ..(let 0 = 0) {}
1722 | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeTo`
1724 = note: expected type `bool`
1725 found struct `RangeTo<bool>`
1727 error[E0308]: mismatched types
1728 --> $DIR/disallowed-positions.rs:257:11
1730 LL | while (let 0 = 0).. {}
1731 | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeFrom`
1733 = note: expected type `bool`
1734 found struct `RangeFrom<bool>`
1736 error[E0308]: mismatched types
1737 --> $DIR/disallowed-positions.rs:263:15
1739 LL | while let Range { start: _, end: _ } = true..true && false {}
1740 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
1742 | expected `bool`, found struct `Range`
1744 = note: expected type `bool`
1745 found struct `std::ops::Range<_>`
1747 error[E0308]: mismatched types
1748 --> $DIR/disallowed-positions.rs:263:11
1750 LL | while let Range { start: _, end: _ } = true..true && false {}
1751 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
1753 = note: expected type `bool`
1754 found struct `std::ops::Range<bool>`
1756 error[E0308]: mismatched types
1757 --> $DIR/disallowed-positions.rs:267:15
1759 LL | while let Range { start: _, end: _ } = true..true || false {}
1760 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
1762 | expected `bool`, found struct `Range`
1764 = note: expected type `bool`
1765 found struct `std::ops::Range<_>`
1767 error[E0308]: mismatched types
1768 --> $DIR/disallowed-positions.rs:267:11
1770 LL | while let Range { start: _, end: _ } = true..true || false {}
1771 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
1773 = note: expected type `bool`
1774 found struct `std::ops::Range<bool>`
1776 error[E0308]: mismatched types
1777 --> $DIR/disallowed-positions.rs:274:15
1779 LL | while let Range { start: F, end } = F..|| true {}
1780 | ^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `fn() -> bool`
1782 | expected fn pointer, found struct `Range`
1784 = note: expected fn pointer `fn() -> bool`
1785 found struct `std::ops::Range<_>`
1787 error[E0308]: mismatched types
1788 --> $DIR/disallowed-positions.rs:274:44
1790 LL | while let Range { start: F, end } = F..|| true {}
1791 | ^^^^^^^ expected `bool`, found closure
1793 = note: expected type `bool`
1794 found closure `[closure@$DIR/disallowed-positions.rs:274:44: 274:46]`
1795 help: use parentheses to call this closure
1797 LL | while let Range { start: F, end } = F..(|| true)() {}
1800 error[E0308]: mismatched types
1801 --> $DIR/disallowed-positions.rs:274:11
1803 LL | while let Range { start: F, end } = F..|| true {}
1804 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
1806 = note: expected type `bool`
1807 found struct `std::ops::Range<bool>`
1809 error[E0308]: mismatched types
1810 --> $DIR/disallowed-positions.rs:282:15
1812 LL | while let Range { start: true, end } = t..&&false {}
1813 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool`
1815 | expected `bool`, found struct `Range`
1817 = note: expected type `bool`
1818 found struct `std::ops::Range<_>`
1820 error[E0308]: mismatched types
1821 --> $DIR/disallowed-positions.rs:282:47
1823 LL | while let Range { start: true, end } = t..&&false {}
1824 | ^^^^^^^ expected `bool`, found `&&bool`
1826 help: consider removing the `&&`
1828 LL - while let Range { start: true, end } = t..&&false {}
1829 LL + while let Range { start: true, end } = t..false {}
1832 error[E0308]: mismatched types
1833 --> $DIR/disallowed-positions.rs:282:11
1835 LL | while let Range { start: true, end } = t..&&false {}
1836 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
1838 = note: expected type `bool`
1839 found struct `std::ops::Range<bool>`
1841 error[E0277]: the `?` operator can only be applied to values that implement `Try`
1842 --> $DIR/disallowed-positions.rs:220:23
1844 LL | while let 0 = 0? {}
1845 | ^^ the `?` operator cannot be applied to type `{integer}`
1847 = help: the trait `Try` is not implemented for `{integer}`
1849 error[E0614]: type `bool` cannot be dereferenced
1850 --> $DIR/disallowed-positions.rs:311:5
1855 error[E0600]: cannot apply unary operator `-` to type `bool`
1856 --> $DIR/disallowed-positions.rs:315:5
1859 | ^^^^^^^^^^ cannot apply unary operator `-`
1861 error[E0277]: the `?` operator can only be applied to values that implement `Try`
1862 --> $DIR/disallowed-positions.rs:325:5
1865 | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
1867 = help: the trait `Try` is not implemented for `bool`
1869 error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
1870 --> $DIR/disallowed-positions.rs:325:16
1872 LL | fn outside_if_and_while_expr() {
1873 | ------------------------------ this function should return `Result` or `Option` to accept `?`
1876 | ^ cannot use the `?` operator in a function that returns `()`
1878 = help: the trait `FromResidual<_>` is not implemented for `()`
1880 error[E0308]: mismatched types
1881 --> $DIR/disallowed-positions.rs:356:10
1883 LL | (let Range { start: _, end: _ } = true..true || false);
1884 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
1886 | expected `bool`, found struct `Range`
1888 = note: expected type `bool`
1889 found struct `std::ops::Range<_>`
1891 error[E0308]: mismatched types
1892 --> $DIR/disallowed-positions.rs:379:5
1894 LL | fn outside_if_and_while_expr() {
1895 | - help: try adding a return type: `-> &bool`
1898 | ^^^^^^^^^^ expected `()`, found `&bool`
1900 error[E0277]: the `?` operator can only be applied to values that implement `Try`
1901 --> $DIR/disallowed-positions.rs:321:17
1904 | ^^ the `?` operator cannot be applied to type `{integer}`
1906 = help: the trait `Try` is not implemented for `{integer}`
1908 error: aborting due to 215 previous errors
1910 Some errors have detailed explanations: E0277, E0308, E0600, E0614.
1911 For more information about an error, try `rustc --explain E0277`.