1 error: expected one of `,` or `>`, found `&&`
2 --> $DIR/disallowed-positions.rs:239:14
5 | ^^ expected one of `,` or `>`
7 error: `let` expressions are not supported here
8 --> $DIR/disallowed-positions.rs:32:9
13 = note: only supported directly in conditions of `if`- and `while`-expressions
14 = note: as well as when nested within `&&` and parenthesis in those conditions
16 error: `let` expressions are not supported here
17 --> $DIR/disallowed-positions.rs:35:9
22 = note: only supported directly in conditions of `if`- and `while`-expressions
23 = note: as well as when nested within `&&` and parenthesis in those conditions
25 error: `let` expressions are not supported here
26 --> $DIR/disallowed-positions.rs:36:9
31 = note: only supported directly in conditions of `if`- and `while`-expressions
32 = note: as well as when nested within `&&` and parenthesis in those conditions
34 error: `let` expressions are not supported here
35 --> $DIR/disallowed-positions.rs:38:9
40 = note: only supported directly in conditions of `if`- and `while`-expressions
41 = note: as well as when nested within `&&` and parenthesis in those conditions
43 error: `let` expressions are not supported here
44 --> $DIR/disallowed-positions.rs:46:9
46 LL | if (let 0 = 0)? {}
49 = note: only supported directly in conditions of `if`- and `while`-expressions
50 = note: as well as when nested within `&&` and parenthesis in those conditions
52 error: `let` expressions are not supported here
53 --> $DIR/disallowed-positions.rs:50:16
55 LL | if true || let 0 = 0 {}
58 = note: only supported directly in conditions of `if`- and `while`-expressions
59 = note: as well as when nested within `&&` and parenthesis in those conditions
61 error: `let` expressions are not supported here
62 --> $DIR/disallowed-positions.rs:51:17
64 LL | if (true || let 0 = 0) {}
67 = note: only supported directly in conditions of `if`- and `while`-expressions
68 = note: as well as when nested within `&&` and parenthesis in those conditions
70 error: `let` expressions are not supported here
71 --> $DIR/disallowed-positions.rs:52:25
73 LL | if true && (true || let 0 = 0) {}
76 = note: only supported directly in conditions of `if`- and `while`-expressions
77 = note: as well as when nested within `&&` and parenthesis in those conditions
79 error: `let` expressions are not supported here
80 --> $DIR/disallowed-positions.rs:53:25
82 LL | if true || (true && let 0 = 0) {}
85 = note: only supported directly in conditions of `if`- and `while`-expressions
86 = note: as well as when nested within `&&` and parenthesis in those conditions
88 error: `let` expressions are not supported here
89 --> $DIR/disallowed-positions.rs:56:12
91 LL | if x = let 0 = 0 {}
94 = note: only supported directly in conditions of `if`- and `while`-expressions
95 = note: as well as when nested within `&&` and parenthesis in those conditions
97 error: `let` expressions are not supported here
98 --> $DIR/disallowed-positions.rs:59:15
100 LL | if true..(let 0 = 0) {}
103 = note: only supported directly in conditions of `if`- and `while`-expressions
104 = note: as well as when nested within `&&` and parenthesis in those conditions
106 error: `let` expressions are not supported here
107 --> $DIR/disallowed-positions.rs:61:11
109 LL | if ..(let 0 = 0) {}
112 = note: only supported directly in conditions of `if`- and `while`-expressions
113 = note: as well as when nested within `&&` and parenthesis in those conditions
115 error: `let` expressions are not supported here
116 --> $DIR/disallowed-positions.rs:63:9
118 LL | if (let 0 = 0).. {}
121 = note: only supported directly in conditions of `if`- and `while`-expressions
122 = note: as well as when nested within `&&` and parenthesis in those conditions
124 error: `let` expressions are not supported here
125 --> $DIR/disallowed-positions.rs:67:8
127 LL | if let Range { start: _, end: _ } = true..true && false {}
128 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
130 = note: only supported directly in conditions of `if`- and `while`-expressions
131 = note: as well as when nested within `&&` and parenthesis in those conditions
133 error: `let` expressions are not supported here
134 --> $DIR/disallowed-positions.rs:71:8
136 LL | if let Range { start: _, end: _ } = true..true || false {}
137 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
139 = note: only supported directly in conditions of `if`- and `while`-expressions
140 = note: as well as when nested within `&&` and parenthesis in those conditions
142 error: `let` expressions are not supported here
143 --> $DIR/disallowed-positions.rs:78:8
145 LL | if let Range { start: F, end } = F..|| true {}
146 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
148 = note: only supported directly in conditions of `if`- and `while`-expressions
149 = note: as well as when nested within `&&` and parenthesis in those conditions
151 error: `let` expressions are not supported here
152 --> $DIR/disallowed-positions.rs:86:8
154 LL | if let Range { start: true, end } = t..&&false {}
155 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
157 = note: only supported directly in conditions of `if`- and `while`-expressions
158 = note: as well as when nested within `&&` and parenthesis in those conditions
160 error: `let` expressions are not supported here
161 --> $DIR/disallowed-positions.rs:92:19
163 LL | if let true = let true = true {}
166 = note: only supported directly in conditions of `if`- and `while`-expressions
167 = note: as well as when nested within `&&` and parenthesis in those conditions
169 error: `let` expressions are not supported here
170 --> $DIR/disallowed-positions.rs:96:12
172 LL | while &let 0 = 0 {}
175 = note: only supported directly in conditions of `if`- and `while`-expressions
176 = note: as well as when nested within `&&` and parenthesis in those conditions
178 error: `let` expressions are not supported here
179 --> $DIR/disallowed-positions.rs:99:12
181 LL | while !let 0 = 0 {}
184 = note: only supported directly in conditions of `if`- and `while`-expressions
185 = note: as well as when nested within `&&` and parenthesis in those conditions
187 error: `let` expressions are not supported here
188 --> $DIR/disallowed-positions.rs:100:12
190 LL | while *let 0 = 0 {}
193 = note: only supported directly in conditions of `if`- and `while`-expressions
194 = note: as well as when nested within `&&` and parenthesis in those conditions
196 error: `let` expressions are not supported here
197 --> $DIR/disallowed-positions.rs:102:12
199 LL | while -let 0 = 0 {}
202 = note: only supported directly in conditions of `if`- and `while`-expressions
203 = note: as well as when nested within `&&` and parenthesis in those conditions
205 error: `let` expressions are not supported here
206 --> $DIR/disallowed-positions.rs:110:12
208 LL | while (let 0 = 0)? {}
211 = note: only supported directly in conditions of `if`- and `while`-expressions
212 = note: as well as when nested within `&&` and parenthesis in those conditions
214 error: `let` expressions are not supported here
215 --> $DIR/disallowed-positions.rs:114:19
217 LL | while true || let 0 = 0 {}
220 = note: only supported directly in conditions of `if`- and `while`-expressions
221 = note: as well as when nested within `&&` and parenthesis in those conditions
223 error: `let` expressions are not supported here
224 --> $DIR/disallowed-positions.rs:115:20
226 LL | while (true || let 0 = 0) {}
229 = note: only supported directly in conditions of `if`- and `while`-expressions
230 = note: as well as when nested within `&&` and parenthesis in those conditions
232 error: `let` expressions are not supported here
233 --> $DIR/disallowed-positions.rs:116:28
235 LL | while true && (true || let 0 = 0) {}
238 = note: only supported directly in conditions of `if`- and `while`-expressions
239 = note: as well as when nested within `&&` and parenthesis in those conditions
241 error: `let` expressions are not supported here
242 --> $DIR/disallowed-positions.rs:117:28
244 LL | while true || (true && let 0 = 0) {}
247 = note: only supported directly in conditions of `if`- and `while`-expressions
248 = note: as well as when nested within `&&` and parenthesis in those conditions
250 error: `let` expressions are not supported here
251 --> $DIR/disallowed-positions.rs:120:15
253 LL | while x = let 0 = 0 {}
256 = note: only supported directly in conditions of `if`- and `while`-expressions
257 = note: as well as when nested within `&&` and parenthesis in those conditions
259 error: `let` expressions are not supported here
260 --> $DIR/disallowed-positions.rs:123:18
262 LL | while true..(let 0 = 0) {}
265 = note: only supported directly in conditions of `if`- and `while`-expressions
266 = note: as well as when nested within `&&` and parenthesis in those conditions
268 error: `let` expressions are not supported here
269 --> $DIR/disallowed-positions.rs:125:14
271 LL | while ..(let 0 = 0) {}
274 = note: only supported directly in conditions of `if`- and `while`-expressions
275 = note: as well as when nested within `&&` and parenthesis in those conditions
277 error: `let` expressions are not supported here
278 --> $DIR/disallowed-positions.rs:127:12
280 LL | while (let 0 = 0).. {}
283 = note: only supported directly in conditions of `if`- and `while`-expressions
284 = note: as well as when nested within `&&` and parenthesis in those conditions
286 error: `let` expressions are not supported here
287 --> $DIR/disallowed-positions.rs:131:11
289 LL | while let Range { start: _, end: _ } = true..true && false {}
290 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
292 = note: only supported directly in conditions of `if`- and `while`-expressions
293 = note: as well as when nested within `&&` and parenthesis in those conditions
295 error: `let` expressions are not supported here
296 --> $DIR/disallowed-positions.rs:135:11
298 LL | while let Range { start: _, end: _ } = true..true || false {}
299 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
301 = note: only supported directly in conditions of `if`- and `while`-expressions
302 = note: as well as when nested within `&&` and parenthesis in those conditions
304 error: `let` expressions are not supported here
305 --> $DIR/disallowed-positions.rs:142:11
307 LL | while let Range { start: F, end } = F..|| true {}
308 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
310 = note: only supported directly in conditions of `if`- and `while`-expressions
311 = note: as well as when nested within `&&` and parenthesis in those conditions
313 error: `let` expressions are not supported here
314 --> $DIR/disallowed-positions.rs:150:11
316 LL | while let Range { start: true, end } = t..&&false {}
317 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
319 = note: only supported directly in conditions of `if`- and `while`-expressions
320 = note: as well as when nested within `&&` and parenthesis in those conditions
322 error: `let` expressions are not supported here
323 --> $DIR/disallowed-positions.rs:156:22
325 LL | while let true = let true = true {}
328 = note: only supported directly in conditions of `if`- and `while`-expressions
329 = note: as well as when nested within `&&` and parenthesis in those conditions
331 error: `let` expressions are not supported here
332 --> $DIR/disallowed-positions.rs:170:6
337 = note: only supported directly in conditions of `if`- and `while`-expressions
338 = note: as well as when nested within `&&` and parenthesis in those conditions
340 error: `let` expressions are not supported here
341 --> $DIR/disallowed-positions.rs:172:6
346 = note: only supported directly in conditions of `if`- and `while`-expressions
347 = note: as well as when nested within `&&` and parenthesis in those conditions
349 error: `let` expressions are not supported here
350 --> $DIR/disallowed-positions.rs:173:6
355 = note: only supported directly in conditions of `if`- and `while`-expressions
356 = note: as well as when nested within `&&` and parenthesis in those conditions
358 error: `let` expressions are not supported here
359 --> $DIR/disallowed-positions.rs:175:6
364 = note: only supported directly in conditions of `if`- and `while`-expressions
365 = note: as well as when nested within `&&` and parenthesis in those conditions
367 error: `let` expressions are not supported here
368 --> $DIR/disallowed-positions.rs:183:6
373 = note: only supported directly in conditions of `if`- and `while`-expressions
374 = note: as well as when nested within `&&` and parenthesis in those conditions
376 error: `let` expressions are not supported here
377 --> $DIR/disallowed-positions.rs:187:13
379 LL | true || let 0 = 0;
382 = note: only supported directly in conditions of `if`- and `while`-expressions
383 = note: as well as when nested within `&&` and parenthesis in those conditions
385 error: `let` expressions are not supported here
386 --> $DIR/disallowed-positions.rs:188:14
388 LL | (true || let 0 = 0);
391 = note: only supported directly in conditions of `if`- and `while`-expressions
392 = note: as well as when nested within `&&` and parenthesis in those conditions
394 error: `let` expressions are not supported here
395 --> $DIR/disallowed-positions.rs:189:22
397 LL | true && (true || let 0 = 0);
400 = note: only supported directly in conditions of `if`- and `while`-expressions
401 = note: as well as when nested within `&&` and parenthesis in those conditions
403 error: `let` expressions are not supported here
404 --> $DIR/disallowed-positions.rs:192:9
409 = note: only supported directly in conditions of `if`- and `while`-expressions
410 = note: as well as when nested within `&&` and parenthesis in those conditions
412 error: `let` expressions are not supported here
413 --> $DIR/disallowed-positions.rs:194:12
415 LL | true..(let 0 = 0);
418 = note: only supported directly in conditions of `if`- and `while`-expressions
419 = note: as well as when nested within `&&` and parenthesis in those conditions
421 error: `let` expressions are not supported here
422 --> $DIR/disallowed-positions.rs:195:8
427 = note: only supported directly in conditions of `if`- and `while`-expressions
428 = note: as well as when nested within `&&` and parenthesis in those conditions
430 error: `let` expressions are not supported here
431 --> $DIR/disallowed-positions.rs:196:6
436 = note: only supported directly in conditions of `if`- and `while`-expressions
437 = note: as well as when nested within `&&` and parenthesis in those conditions
439 error: `let` expressions are not supported here
440 --> $DIR/disallowed-positions.rs:198:6
442 LL | (let Range { start: _, end: _ } = true..true || false);
443 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
445 = note: only supported directly in conditions of `if`- and `while`-expressions
446 = note: as well as when nested within `&&` and parenthesis in those conditions
448 error: `let` expressions are not supported here
449 --> $DIR/disallowed-positions.rs:202:6
451 LL | (let true = let true = true);
452 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
454 = note: only supported directly in conditions of `if`- and `while`-expressions
455 = note: as well as when nested within `&&` and parenthesis in those conditions
457 error: `let` expressions are not supported here
458 --> $DIR/disallowed-positions.rs:202:17
460 LL | (let true = let true = true);
463 = note: only supported directly in conditions of `if`- and `while`-expressions
464 = note: as well as when nested within `&&` and parenthesis in those conditions
466 error: `let` expressions are not supported here
467 --> $DIR/disallowed-positions.rs:207:6
472 = note: only supported directly in conditions of `if`- and `while`-expressions
473 = note: as well as when nested within `&&` and parenthesis in those conditions
475 error: `let` expressions are not supported here
476 --> $DIR/disallowed-positions.rs:218:17
478 LL | true && let 1 = 1
481 = note: only supported directly in conditions of `if`- and `while`-expressions
482 = note: as well as when nested within `&&` and parenthesis in those conditions
484 error: `let` expressions are not supported here
485 --> $DIR/disallowed-positions.rs:223:17
487 LL | true && let 1 = 1
490 = note: only supported directly in conditions of `if`- and `while`-expressions
491 = note: as well as when nested within `&&` and parenthesis in those conditions
493 error: `let` expressions are not supported here
494 --> $DIR/disallowed-positions.rs:228:17
496 LL | true && let 1 = 1
499 = note: only supported directly in conditions of `if`- and `while`-expressions
500 = note: as well as when nested within `&&` and parenthesis in those conditions
502 warning: the feature `const_generics` is incomplete and may cause the compiler to crash
503 --> $DIR/disallowed-positions.rs:20:12
505 LL | #![feature(const_generics)]
508 = note: `#[warn(incomplete_features)]` on by default
510 warning: the feature `let_chains` is incomplete and may cause the compiler to crash
511 --> $DIR/disallowed-positions.rs:22:12
513 LL | #![feature(let_chains)] // Avoid inflating `.stderr` with overzealous gates in this test.
516 error[E0744]: `match` is not allowed in a `const`
517 --> $DIR/disallowed-positions.rs:218:17
519 LL | true && let 1 = 1
522 error[E0744]: `match` is not allowed in a `const`
523 --> $DIR/disallowed-positions.rs:223:17
525 LL | true && let 1 = 1
528 error[E0744]: `match` is not allowed in a `const`
529 --> $DIR/disallowed-positions.rs:228:17
531 LL | true && let 1 = 1
534 error[E0308]: mismatched types
535 --> $DIR/disallowed-positions.rs:32:8
537 LL | if &let 0 = 0 {}
540 | expected bool, found &bool
541 | help: consider removing the borrow: `let 0 = 0`
543 = note: expected type `bool`
544 found reference `&bool`
546 error[E0614]: type `bool` cannot be dereferenced
547 --> $DIR/disallowed-positions.rs:36:8
549 LL | if *let 0 = 0 {}
552 error[E0600]: cannot apply unary operator `-` to type `bool`
553 --> $DIR/disallowed-positions.rs:38:8
555 LL | if -let 0 = 0 {}
556 | ^^^^^^^^^^ cannot apply unary operator `-`
558 = note: an implementation of `std::ops::Neg` might be missing for `bool`
560 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
561 --> $DIR/disallowed-positions.rs:46:8
563 LL | if (let 0 = 0)? {}
564 | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
566 = help: the trait `std::ops::Try` is not implemented for `bool`
567 = note: required by `std::ops::Try::into_result`
569 error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
570 --> $DIR/disallowed-positions.rs:46:8
572 LL | if (let 0 = 0)? {}
573 | ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
575 = help: the trait `std::ops::Try` is not implemented for `()`
576 = note: required by `std::ops::Try::from_error`
578 error[E0308]: mismatched types
579 --> $DIR/disallowed-positions.rs:56:8
581 LL | if x = let 0 = 0 {}
584 | expected bool, found ()
585 | help: try comparing for equality: `x == let 0 = 0`
587 = note: expected type `bool`
590 error[E0308]: mismatched types
591 --> $DIR/disallowed-positions.rs:59:8
593 LL | if true..(let 0 = 0) {}
594 | ^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
596 = note: expected type `bool`
597 found struct `std::ops::Range<bool>`
599 error[E0308]: mismatched types
600 --> $DIR/disallowed-positions.rs:61:8
602 LL | if ..(let 0 = 0) {}
603 | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeTo`
605 = note: expected type `bool`
606 found struct `std::ops::RangeTo<bool>`
608 error[E0308]: mismatched types
609 --> $DIR/disallowed-positions.rs:63:8
611 LL | if (let 0 = 0).. {}
612 | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeFrom`
614 = note: expected type `bool`
615 found struct `std::ops::RangeFrom<bool>`
617 error[E0308]: mismatched types
618 --> $DIR/disallowed-positions.rs:67:12
620 LL | if let Range { start: _, end: _ } = true..true && false {}
621 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
623 | expected bool, found struct `std::ops::Range`
625 = note: expected type `bool`
626 found struct `std::ops::Range<_>`
628 error[E0308]: mismatched types
629 --> $DIR/disallowed-positions.rs:67:8
631 LL | if let Range { start: _, end: _ } = true..true && false {}
632 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
634 = note: expected type `bool`
635 found struct `std::ops::Range<bool>`
637 error[E0308]: mismatched types
638 --> $DIR/disallowed-positions.rs:71:12
640 LL | if let Range { start: _, end: _ } = true..true || false {}
641 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
643 | expected bool, found struct `std::ops::Range`
645 = note: expected type `bool`
646 found struct `std::ops::Range<_>`
648 error[E0308]: mismatched types
649 --> $DIR/disallowed-positions.rs:71:8
651 LL | if let Range { start: _, end: _ } = true..true || false {}
652 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
654 = note: expected type `bool`
655 found struct `std::ops::Range<bool>`
657 error[E0308]: mismatched types
658 --> $DIR/disallowed-positions.rs:78:12
660 LL | if let Range { start: F, end } = F..|| true {}
661 | ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found struct `std::ops::Range`
663 = note: expected fn pointer `fn() -> bool`
664 found struct `std::ops::Range<_>`
666 error[E0308]: mismatched types
667 --> $DIR/disallowed-positions.rs:78:41
669 LL | if let Range { start: F, end } = F..|| true {}
670 | ^^^^^^^ expected bool, found closure
672 = note: expected type `bool`
673 found closure `[closure@$DIR/disallowed-positions.rs:78:41: 78:48]`
675 error[E0308]: mismatched types
676 --> $DIR/disallowed-positions.rs:78:8
678 LL | if let Range { start: F, end } = F..|| true {}
679 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
681 = note: expected type `bool`
682 found struct `std::ops::Range<bool>`
684 error[E0308]: mismatched types
685 --> $DIR/disallowed-positions.rs:86:12
687 LL | if let Range { start: true, end } = t..&&false {}
688 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this match expression has type `bool`
690 | expected bool, found struct `std::ops::Range`
692 = note: expected type `bool`
693 found struct `std::ops::Range<_>`
695 error[E0308]: mismatched types
696 --> $DIR/disallowed-positions.rs:86:44
698 LL | if let Range { start: true, end } = t..&&false {}
699 | ^^^^^^^ expected bool, found &&bool
701 = note: expected type `bool`
702 found reference `&&bool`
704 error[E0308]: mismatched types
705 --> $DIR/disallowed-positions.rs:86:8
707 LL | if let Range { start: true, end } = t..&&false {}
708 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
710 = note: expected type `bool`
711 found struct `std::ops::Range<bool>`
713 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
714 --> $DIR/disallowed-positions.rs:42:20
716 LL | if let 0 = 0? {}
717 | ^^ the `?` operator cannot be applied to type `{integer}`
719 = help: the trait `std::ops::Try` is not implemented for `{integer}`
720 = note: required by `std::ops::Try::into_result`
722 error[E0308]: mismatched types
723 --> $DIR/disallowed-positions.rs:96:11
725 LL | while &let 0 = 0 {}
728 | expected bool, found &bool
729 | help: consider removing the borrow: `let 0 = 0`
731 = note: expected type `bool`
732 found reference `&bool`
734 error[E0614]: type `bool` cannot be dereferenced
735 --> $DIR/disallowed-positions.rs:100:11
737 LL | while *let 0 = 0 {}
740 error[E0600]: cannot apply unary operator `-` to type `bool`
741 --> $DIR/disallowed-positions.rs:102:11
743 LL | while -let 0 = 0 {}
744 | ^^^^^^^^^^ cannot apply unary operator `-`
746 = note: an implementation of `std::ops::Neg` might be missing for `bool`
748 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
749 --> $DIR/disallowed-positions.rs:110:11
751 LL | while (let 0 = 0)? {}
752 | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
754 = help: the trait `std::ops::Try` is not implemented for `bool`
755 = note: required by `std::ops::Try::into_result`
757 error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
758 --> $DIR/disallowed-positions.rs:110:11
760 LL | while (let 0 = 0)? {}
761 | ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
763 = help: the trait `std::ops::Try` is not implemented for `()`
764 = note: required by `std::ops::Try::from_error`
766 error[E0308]: mismatched types
767 --> $DIR/disallowed-positions.rs:120:11
769 LL | while x = let 0 = 0 {}
772 | expected bool, found ()
773 | help: try comparing for equality: `x == let 0 = 0`
775 = note: expected type `bool`
778 error[E0308]: mismatched types
779 --> $DIR/disallowed-positions.rs:123:11
781 LL | while true..(let 0 = 0) {}
782 | ^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
784 = note: expected type `bool`
785 found struct `std::ops::Range<bool>`
787 error[E0308]: mismatched types
788 --> $DIR/disallowed-positions.rs:125:11
790 LL | while ..(let 0 = 0) {}
791 | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeTo`
793 = note: expected type `bool`
794 found struct `std::ops::RangeTo<bool>`
796 error[E0308]: mismatched types
797 --> $DIR/disallowed-positions.rs:127:11
799 LL | while (let 0 = 0).. {}
800 | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeFrom`
802 = note: expected type `bool`
803 found struct `std::ops::RangeFrom<bool>`
805 error[E0308]: mismatched types
806 --> $DIR/disallowed-positions.rs:131:15
808 LL | while let Range { start: _, end: _ } = true..true && false {}
809 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
811 | expected bool, found struct `std::ops::Range`
813 = note: expected type `bool`
814 found struct `std::ops::Range<_>`
816 error[E0308]: mismatched types
817 --> $DIR/disallowed-positions.rs:131:11
819 LL | while let Range { start: _, end: _ } = true..true && false {}
820 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
822 = note: expected type `bool`
823 found struct `std::ops::Range<bool>`
825 error[E0308]: mismatched types
826 --> $DIR/disallowed-positions.rs:135:15
828 LL | while let Range { start: _, end: _ } = true..true || false {}
829 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
831 | expected bool, found struct `std::ops::Range`
833 = note: expected type `bool`
834 found struct `std::ops::Range<_>`
836 error[E0308]: mismatched types
837 --> $DIR/disallowed-positions.rs:135:11
839 LL | while let Range { start: _, end: _ } = true..true || false {}
840 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
842 = note: expected type `bool`
843 found struct `std::ops::Range<bool>`
845 error[E0308]: mismatched types
846 --> $DIR/disallowed-positions.rs:142:15
848 LL | while let Range { start: F, end } = F..|| true {}
849 | ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found struct `std::ops::Range`
851 = note: expected fn pointer `fn() -> bool`
852 found struct `std::ops::Range<_>`
854 error[E0308]: mismatched types
855 --> $DIR/disallowed-positions.rs:142:44
857 LL | while let Range { start: F, end } = F..|| true {}
858 | ^^^^^^^ expected bool, found closure
860 = note: expected type `bool`
861 found closure `[closure@$DIR/disallowed-positions.rs:142:44: 142:51]`
863 error[E0308]: mismatched types
864 --> $DIR/disallowed-positions.rs:142:11
866 LL | while let Range { start: F, end } = F..|| true {}
867 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
869 = note: expected type `bool`
870 found struct `std::ops::Range<bool>`
872 error[E0308]: mismatched types
873 --> $DIR/disallowed-positions.rs:150:15
875 LL | while let Range { start: true, end } = t..&&false {}
876 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this match expression has type `bool`
878 | expected bool, found struct `std::ops::Range`
880 = note: expected type `bool`
881 found struct `std::ops::Range<_>`
883 error[E0308]: mismatched types
884 --> $DIR/disallowed-positions.rs:150:47
886 LL | while let Range { start: true, end } = t..&&false {}
887 | ^^^^^^^ expected bool, found &&bool
889 = note: expected type `bool`
890 found reference `&&bool`
892 error[E0308]: mismatched types
893 --> $DIR/disallowed-positions.rs:150:11
895 LL | while let Range { start: true, end } = t..&&false {}
896 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
898 = note: expected type `bool`
899 found struct `std::ops::Range<bool>`
901 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
902 --> $DIR/disallowed-positions.rs:106:23
904 LL | while let 0 = 0? {}
905 | ^^ the `?` operator cannot be applied to type `{integer}`
907 = help: the trait `std::ops::Try` is not implemented for `{integer}`
908 = note: required by `std::ops::Try::into_result`
910 error[E0614]: type `bool` cannot be dereferenced
911 --> $DIR/disallowed-positions.rs:173:5
916 error[E0600]: cannot apply unary operator `-` to type `bool`
917 --> $DIR/disallowed-positions.rs:175:5
920 | ^^^^^^^^^^ cannot apply unary operator `-`
922 = note: an implementation of `std::ops::Neg` might be missing for `bool`
924 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
925 --> $DIR/disallowed-positions.rs:183:5
928 | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
930 = help: the trait `std::ops::Try` is not implemented for `bool`
931 = note: required by `std::ops::Try::into_result`
933 error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
934 --> $DIR/disallowed-positions.rs:183:5
937 | ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
939 = help: the trait `std::ops::Try` is not implemented for `()`
940 = note: required by `std::ops::Try::from_error`
942 error[E0308]: mismatched types
943 --> $DIR/disallowed-positions.rs:198:10
945 LL | (let Range { start: _, end: _ } = true..true || false);
946 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
948 | expected bool, found struct `std::ops::Range`
950 = note: expected type `bool`
951 found struct `std::ops::Range<_>`
953 error[E0308]: mismatched types
954 --> $DIR/disallowed-positions.rs:207:5
956 LL | fn outside_if_and_while_expr() {
957 | - help: try adding a return type: `-> &bool`
960 | ^^^^^^^^^^ expected (), found &bool
962 = note: expected unit type `()`
963 found reference `&bool`
965 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
966 --> $DIR/disallowed-positions.rs:179:17
969 | ^^ the `?` operator cannot be applied to type `{integer}`
971 = help: the trait `std::ops::Try` is not implemented for `{integer}`
972 = note: required by `std::ops::Try::into_result`
974 error: aborting due to 106 previous errors
976 Some errors have detailed explanations: E0277, E0308, E0600, E0614, E0744.
977 For more information about an error, try `rustc --explain E0277`.