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 LL | | if &let 0 = 0 {}
1501 LL | | if (let 0 = 0)? {}
1502 | | ^ cannot use the `?` operator in a function that returns `()`
1506 | |_- this function should return `Result` or `Option` to accept `?`
1508 = help: the trait `FromResidual<_>` is not implemented for `()`
1510 error[E0308]: mismatched types
1511 --> $DIR/disallowed-positions.rs:152:8
1513 LL | if x = let 0 = 0 {}
1514 | ^^^^^^^^^^^^^ expected `bool`, found `()`
1516 help: you might have meant to compare for equality
1518 LL | if x == let 0 = 0 {}
1521 error[E0308]: mismatched types
1522 --> $DIR/disallowed-positions.rs:157:8
1524 LL | if true..(let 0 = 0) {}
1525 | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
1527 = note: expected type `bool`
1528 found struct `std::ops::Range<bool>`
1530 error[E0308]: mismatched types
1531 --> $DIR/disallowed-positions.rs:161:8
1533 LL | if ..(let 0 = 0) {}
1534 | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeTo`
1536 = note: expected type `bool`
1537 found struct `RangeTo<bool>`
1539 error[E0308]: mismatched types
1540 --> $DIR/disallowed-positions.rs:165:8
1542 LL | if (let 0 = 0).. {}
1543 | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeFrom`
1545 = note: expected type `bool`
1546 found struct `RangeFrom<bool>`
1548 error[E0308]: mismatched types
1549 --> $DIR/disallowed-positions.rs:171:12
1551 LL | if let Range { start: _, end: _ } = true..true && false {}
1552 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
1554 | expected `bool`, found struct `std::ops::Range`
1556 = note: expected type `bool`
1557 found struct `std::ops::Range<_>`
1559 error[E0308]: mismatched types
1560 --> $DIR/disallowed-positions.rs:171:8
1562 LL | if let Range { start: _, end: _ } = true..true && false {}
1563 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
1565 = note: expected type `bool`
1566 found struct `std::ops::Range<bool>`
1568 error[E0308]: mismatched types
1569 --> $DIR/disallowed-positions.rs:175:12
1571 LL | if let Range { start: _, end: _ } = true..true || false {}
1572 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
1574 | expected `bool`, found struct `std::ops::Range`
1576 = note: expected type `bool`
1577 found struct `std::ops::Range<_>`
1579 error[E0308]: mismatched types
1580 --> $DIR/disallowed-positions.rs:175:8
1582 LL | if let Range { start: _, end: _ } = true..true || false {}
1583 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
1585 = note: expected type `bool`
1586 found struct `std::ops::Range<bool>`
1588 error[E0308]: mismatched types
1589 --> $DIR/disallowed-positions.rs:182:12
1591 LL | if let Range { start: F, end } = F..|| true {}
1592 | ^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `fn() -> bool`
1594 | expected fn pointer, found struct `std::ops::Range`
1596 = note: expected fn pointer `fn() -> bool`
1597 found struct `std::ops::Range<_>`
1599 error[E0308]: mismatched types
1600 --> $DIR/disallowed-positions.rs:182:41
1602 LL | if let Range { start: F, end } = F..|| true {}
1603 | ^^^^^^^ expected `bool`, found closure
1605 = note: expected type `bool`
1606 found closure `[closure@$DIR/disallowed-positions.rs:182:41: 182:43]`
1607 help: use parentheses to call this closure
1609 LL | if let Range { start: F, end } = F..(|| true)() {}
1612 error[E0308]: mismatched types
1613 --> $DIR/disallowed-positions.rs:182:8
1615 LL | if let Range { start: F, end } = F..|| true {}
1616 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
1618 = note: expected type `bool`
1619 found struct `std::ops::Range<bool>`
1621 error[E0308]: mismatched types
1622 --> $DIR/disallowed-positions.rs:190:12
1624 LL | if let Range { start: true, end } = t..&&false {}
1625 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool`
1627 | expected `bool`, found struct `std::ops::Range`
1629 = note: expected type `bool`
1630 found struct `std::ops::Range<_>`
1632 error[E0308]: mismatched types
1633 --> $DIR/disallowed-positions.rs:190:44
1635 LL | if let Range { start: true, end } = t..&&false {}
1636 | ^^^^^^^ expected `bool`, found `&&bool`
1638 help: consider removing the `&&`
1640 LL - if let Range { start: true, end } = t..&&false {}
1641 LL + if let Range { start: true, end } = t..false {}
1644 error[E0308]: mismatched types
1645 --> $DIR/disallowed-positions.rs:190:8
1647 LL | if let Range { start: true, end } = t..&&false {}
1648 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
1650 = note: expected type `bool`
1651 found struct `std::ops::Range<bool>`
1653 error[E0277]: the `?` operator can only be applied to values that implement `Try`
1654 --> $DIR/disallowed-positions.rs:128:20
1656 LL | if let 0 = 0? {}
1657 | ^^ the `?` operator cannot be applied to type `{integer}`
1659 = help: the trait `Try` is not implemented for `{integer}`
1661 error[E0308]: mismatched types
1662 --> $DIR/disallowed-positions.rs:202:11
1664 LL | while &let 0 = 0 {}
1665 | ^^^^^^^^^^ expected `bool`, found `&bool`
1667 help: consider removing the borrow
1669 LL - while &let 0 = 0 {}
1670 LL + while let 0 = 0 {}
1673 error[E0614]: type `bool` cannot be dereferenced
1674 --> $DIR/disallowed-positions.rs:210:11
1676 LL | while *let 0 = 0 {}
1679 error[E0600]: cannot apply unary operator `-` to type `bool`
1680 --> $DIR/disallowed-positions.rs:214:11
1682 LL | while -let 0 = 0 {}
1683 | ^^^^^^^^^^ cannot apply unary operator `-`
1685 error[E0277]: the `?` operator can only be applied to values that implement `Try`
1686 --> $DIR/disallowed-positions.rs:224:11
1688 LL | while (let 0 = 0)? {}
1689 | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
1691 = help: the trait `Try` is not implemented for `bool`
1693 error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
1694 --> $DIR/disallowed-positions.rs:224:22
1696 LL | / fn nested_within_while_expr() {
1697 LL | | while &let 0 = 0 {}
1701 LL | | while (let 0 = 0)? {}
1702 | | ^ cannot use the `?` operator in a function that returns `()`
1706 | |_- this function should return `Result` or `Option` to accept `?`
1708 = help: the trait `FromResidual<_>` is not implemented for `()`
1710 error[E0308]: mismatched types
1711 --> $DIR/disallowed-positions.rs:244:11
1713 LL | while x = let 0 = 0 {}
1714 | ^^^^^^^^^^^^^ expected `bool`, found `()`
1716 help: you might have meant to compare for equality
1718 LL | while x == let 0 = 0 {}
1721 error[E0308]: mismatched types
1722 --> $DIR/disallowed-positions.rs:249:11
1724 LL | while true..(let 0 = 0) {}
1725 | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
1727 = note: expected type `bool`
1728 found struct `std::ops::Range<bool>`
1730 error[E0308]: mismatched types
1731 --> $DIR/disallowed-positions.rs:253:11
1733 LL | while ..(let 0 = 0) {}
1734 | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeTo`
1736 = note: expected type `bool`
1737 found struct `RangeTo<bool>`
1739 error[E0308]: mismatched types
1740 --> $DIR/disallowed-positions.rs:257:11
1742 LL | while (let 0 = 0).. {}
1743 | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeFrom`
1745 = note: expected type `bool`
1746 found struct `RangeFrom<bool>`
1748 error[E0308]: mismatched types
1749 --> $DIR/disallowed-positions.rs:263:15
1751 LL | while let Range { start: _, end: _ } = true..true && false {}
1752 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
1754 | expected `bool`, found struct `std::ops::Range`
1756 = note: expected type `bool`
1757 found struct `std::ops::Range<_>`
1759 error[E0308]: mismatched types
1760 --> $DIR/disallowed-positions.rs:263:11
1762 LL | while let Range { start: _, end: _ } = true..true && false {}
1763 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
1765 = note: expected type `bool`
1766 found struct `std::ops::Range<bool>`
1768 error[E0308]: mismatched types
1769 --> $DIR/disallowed-positions.rs:267:15
1771 LL | while let Range { start: _, end: _ } = true..true || false {}
1772 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
1774 | expected `bool`, found struct `std::ops::Range`
1776 = note: expected type `bool`
1777 found struct `std::ops::Range<_>`
1779 error[E0308]: mismatched types
1780 --> $DIR/disallowed-positions.rs:267:11
1782 LL | while let Range { start: _, end: _ } = true..true || false {}
1783 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
1785 = note: expected type `bool`
1786 found struct `std::ops::Range<bool>`
1788 error[E0308]: mismatched types
1789 --> $DIR/disallowed-positions.rs:274:15
1791 LL | while let Range { start: F, end } = F..|| true {}
1792 | ^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `fn() -> bool`
1794 | expected fn pointer, found struct `std::ops::Range`
1796 = note: expected fn pointer `fn() -> bool`
1797 found struct `std::ops::Range<_>`
1799 error[E0308]: mismatched types
1800 --> $DIR/disallowed-positions.rs:274:44
1802 LL | while let Range { start: F, end } = F..|| true {}
1803 | ^^^^^^^ expected `bool`, found closure
1805 = note: expected type `bool`
1806 found closure `[closure@$DIR/disallowed-positions.rs:274:44: 274:46]`
1807 help: use parentheses to call this closure
1809 LL | while let Range { start: F, end } = F..(|| true)() {}
1812 error[E0308]: mismatched types
1813 --> $DIR/disallowed-positions.rs:274:11
1815 LL | while let Range { start: F, end } = F..|| true {}
1816 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
1818 = note: expected type `bool`
1819 found struct `std::ops::Range<bool>`
1821 error[E0308]: mismatched types
1822 --> $DIR/disallowed-positions.rs:282:15
1824 LL | while let Range { start: true, end } = t..&&false {}
1825 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool`
1827 | expected `bool`, found struct `std::ops::Range`
1829 = note: expected type `bool`
1830 found struct `std::ops::Range<_>`
1832 error[E0308]: mismatched types
1833 --> $DIR/disallowed-positions.rs:282:47
1835 LL | while let Range { start: true, end } = t..&&false {}
1836 | ^^^^^^^ expected `bool`, found `&&bool`
1838 help: consider removing the `&&`
1840 LL - while let Range { start: true, end } = t..&&false {}
1841 LL + while let Range { start: true, end } = t..false {}
1844 error[E0308]: mismatched types
1845 --> $DIR/disallowed-positions.rs:282:11
1847 LL | while let Range { start: true, end } = t..&&false {}
1848 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
1850 = note: expected type `bool`
1851 found struct `std::ops::Range<bool>`
1853 error[E0277]: the `?` operator can only be applied to values that implement `Try`
1854 --> $DIR/disallowed-positions.rs:220:23
1856 LL | while let 0 = 0? {}
1857 | ^^ the `?` operator cannot be applied to type `{integer}`
1859 = help: the trait `Try` is not implemented for `{integer}`
1861 error[E0614]: type `bool` cannot be dereferenced
1862 --> $DIR/disallowed-positions.rs:311:5
1867 error[E0600]: cannot apply unary operator `-` to type `bool`
1868 --> $DIR/disallowed-positions.rs:315:5
1871 | ^^^^^^^^^^ cannot apply unary operator `-`
1873 error[E0277]: the `?` operator can only be applied to values that implement `Try`
1874 --> $DIR/disallowed-positions.rs:325:5
1877 | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
1879 = help: the trait `Try` is not implemented for `bool`
1881 error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
1882 --> $DIR/disallowed-positions.rs:325:16
1884 LL | / fn outside_if_and_while_expr() {
1889 LL | | (let 0 = 0)?;
1890 | | ^ cannot use the `?` operator in a function that returns `()`
1894 | |_- this function should return `Result` or `Option` to accept `?`
1896 = help: the trait `FromResidual<_>` is not implemented for `()`
1898 error[E0308]: mismatched types
1899 --> $DIR/disallowed-positions.rs:356:10
1901 LL | (let Range { start: _, end: _ } = true..true || false);
1902 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
1904 | expected `bool`, found struct `std::ops::Range`
1906 = note: expected type `bool`
1907 found struct `std::ops::Range<_>`
1909 error[E0308]: mismatched types
1910 --> $DIR/disallowed-positions.rs:379:5
1912 LL | fn outside_if_and_while_expr() {
1913 | - help: try adding a return type: `-> &bool`
1916 | ^^^^^^^^^^ expected `()`, found `&bool`
1918 error[E0277]: the `?` operator can only be applied to values that implement `Try`
1919 --> $DIR/disallowed-positions.rs:321:17
1922 | ^^ the `?` operator cannot be applied to type `{integer}`
1924 = help: the trait `Try` is not implemented for `{integer}`
1926 error: aborting due to 215 previous errors
1928 Some errors have detailed explanations: E0277, E0308, E0600, E0614.
1929 For more information about an error, try `rustc --explain E0277`.