1 error: expected one of `,` or `>`, found `&&`
2 --> $DIR/disallowed-positions.rs:242:14
5 | ^^ expected one of `,` or `>` here
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:224: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:230: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[E0308]: mismatched types
517 --> $DIR/disallowed-positions.rs:32:8
519 LL | if &let 0 = 0 {}
520 | ^^^^^^^^^^ expected bool, found &bool
522 = note: expected type `bool`
525 error[E0614]: type `bool` cannot be dereferenced
526 --> $DIR/disallowed-positions.rs:36:8
528 LL | if *let 0 = 0 {}
531 error[E0600]: cannot apply unary operator `-` to type `bool`
532 --> $DIR/disallowed-positions.rs:38:8
534 LL | if -let 0 = 0 {}
535 | ^^^^^^^^^^ cannot apply unary operator `-`
537 = note: an implementation of `std::ops::Neg` might be missing for `bool`
539 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
540 --> $DIR/disallowed-positions.rs:46:8
542 LL | if (let 0 = 0)? {}
543 | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
545 = help: the trait `std::ops::Try` is not implemented for `bool`
546 = note: required by `std::ops::Try::into_result`
548 error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
549 --> $DIR/disallowed-positions.rs:46:8
551 LL | if (let 0 = 0)? {}
552 | ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
554 = help: the trait `std::ops::Try` is not implemented for `()`
555 = note: required by `std::ops::Try::from_error`
557 error[E0308]: mismatched types
558 --> $DIR/disallowed-positions.rs:56:8
560 LL | if x = let 0 = 0 {}
563 | expected bool, found ()
564 | help: try comparing for equality: `x == let 0 = 0`
566 = note: expected type `bool`
569 error[E0308]: mismatched types
570 --> $DIR/disallowed-positions.rs:59:8
572 LL | if true..(let 0 = 0) {}
573 | ^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
575 = note: expected type `bool`
576 found type `std::ops::Range<bool>`
578 error[E0308]: mismatched types
579 --> $DIR/disallowed-positions.rs:61:8
581 LL | if ..(let 0 = 0) {}
582 | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeTo`
584 = note: expected type `bool`
585 found type `std::ops::RangeTo<bool>`
587 error[E0308]: mismatched types
588 --> $DIR/disallowed-positions.rs:63:8
590 LL | if (let 0 = 0).. {}
591 | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeFrom`
593 = note: expected type `bool`
594 found type `std::ops::RangeFrom<bool>`
596 error[E0308]: mismatched types
597 --> $DIR/disallowed-positions.rs:67:12
599 LL | if let Range { start: _, end: _ } = true..true && false {}
600 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
602 | expected bool, found struct `std::ops::Range`
604 = note: expected type `bool`
605 found type `std::ops::Range<_>`
607 error[E0308]: mismatched types
608 --> $DIR/disallowed-positions.rs:67:8
610 LL | if let Range { start: _, end: _ } = true..true && false {}
611 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
613 = note: expected type `bool`
614 found type `std::ops::Range<bool>`
616 error[E0308]: mismatched types
617 --> $DIR/disallowed-positions.rs:71:12
619 LL | if let Range { start: _, end: _ } = true..true || false {}
620 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
622 | expected bool, found struct `std::ops::Range`
624 = note: expected type `bool`
625 found type `std::ops::Range<_>`
627 error[E0308]: mismatched types
628 --> $DIR/disallowed-positions.rs:71:8
630 LL | if let Range { start: _, end: _ } = true..true || false {}
631 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
633 = note: expected type `bool`
634 found type `std::ops::Range<bool>`
636 error[E0308]: mismatched types
637 --> $DIR/disallowed-positions.rs:78:12
639 LL | if let Range { start: F, end } = F..|| true {}
640 | ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found struct `std::ops::Range`
642 = note: expected type `fn() -> bool`
643 found type `std::ops::Range<_>`
645 error[E0308]: mismatched types
646 --> $DIR/disallowed-positions.rs:78:41
648 LL | if let Range { start: F, end } = F..|| true {}
649 | ^^^^^^^ expected bool, found closure
651 = note: expected type `bool`
652 found type `[closure@$DIR/disallowed-positions.rs:78:41: 78:48]`
654 error[E0308]: mismatched types
655 --> $DIR/disallowed-positions.rs:78:8
657 LL | if let Range { start: F, end } = F..|| true {}
658 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
660 = note: expected type `bool`
661 found type `std::ops::Range<bool>`
663 error[E0308]: mismatched types
664 --> $DIR/disallowed-positions.rs:86:12
666 LL | if let Range { start: true, end } = t..&&false {}
667 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this match expression has type `bool`
669 | expected bool, found struct `std::ops::Range`
671 = note: expected type `bool`
672 found type `std::ops::Range<_>`
674 error[E0308]: mismatched types
675 --> $DIR/disallowed-positions.rs:86:44
677 LL | if let Range { start: true, end } = t..&&false {}
678 | ^^^^^^^ expected bool, found &&bool
680 = note: expected type `bool`
683 error[E0308]: mismatched types
684 --> $DIR/disallowed-positions.rs:86:8
686 LL | if let Range { start: true, end } = t..&&false {}
687 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
689 = note: expected type `bool`
690 found type `std::ops::Range<bool>`
692 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
693 --> $DIR/disallowed-positions.rs:42:20
695 LL | if let 0 = 0? {}
696 | ^^ the `?` operator cannot be applied to type `{integer}`
698 = help: the trait `std::ops::Try` is not implemented for `{integer}`
699 = note: required by `std::ops::Try::into_result`
701 error[E0308]: mismatched types
702 --> $DIR/disallowed-positions.rs:96:11
704 LL | while &let 0 = 0 {}
705 | ^^^^^^^^^^ expected bool, found &bool
707 = note: expected type `bool`
710 error[E0614]: type `bool` cannot be dereferenced
711 --> $DIR/disallowed-positions.rs:100:11
713 LL | while *let 0 = 0 {}
716 error[E0600]: cannot apply unary operator `-` to type `bool`
717 --> $DIR/disallowed-positions.rs:102:11
719 LL | while -let 0 = 0 {}
720 | ^^^^^^^^^^ cannot apply unary operator `-`
722 = note: an implementation of `std::ops::Neg` might be missing for `bool`
724 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
725 --> $DIR/disallowed-positions.rs:110:11
727 LL | while (let 0 = 0)? {}
728 | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
730 = help: the trait `std::ops::Try` is not implemented for `bool`
731 = note: required by `std::ops::Try::into_result`
733 error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
734 --> $DIR/disallowed-positions.rs:110:11
736 LL | while (let 0 = 0)? {}
737 | ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
739 = help: the trait `std::ops::Try` is not implemented for `()`
740 = note: required by `std::ops::Try::from_error`
742 error[E0308]: mismatched types
743 --> $DIR/disallowed-positions.rs:120:11
745 LL | while x = let 0 = 0 {}
748 | expected bool, found ()
749 | help: try comparing for equality: `x == let 0 = 0`
751 = note: expected type `bool`
754 error[E0308]: mismatched types
755 --> $DIR/disallowed-positions.rs:123:11
757 LL | while true..(let 0 = 0) {}
758 | ^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
760 = note: expected type `bool`
761 found type `std::ops::Range<bool>`
763 error[E0308]: mismatched types
764 --> $DIR/disallowed-positions.rs:125:11
766 LL | while ..(let 0 = 0) {}
767 | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeTo`
769 = note: expected type `bool`
770 found type `std::ops::RangeTo<bool>`
772 error[E0308]: mismatched types
773 --> $DIR/disallowed-positions.rs:127:11
775 LL | while (let 0 = 0).. {}
776 | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeFrom`
778 = note: expected type `bool`
779 found type `std::ops::RangeFrom<bool>`
781 error[E0308]: mismatched types
782 --> $DIR/disallowed-positions.rs:131:15
784 LL | while let Range { start: _, end: _ } = true..true && false {}
785 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
787 | expected bool, found struct `std::ops::Range`
789 = note: expected type `bool`
790 found type `std::ops::Range<_>`
792 error[E0308]: mismatched types
793 --> $DIR/disallowed-positions.rs:131:11
795 LL | while let Range { start: _, end: _ } = true..true && false {}
796 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
798 = note: expected type `bool`
799 found type `std::ops::Range<bool>`
801 error[E0308]: mismatched types
802 --> $DIR/disallowed-positions.rs:135:15
804 LL | while let Range { start: _, end: _ } = true..true || false {}
805 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
807 | expected bool, found struct `std::ops::Range`
809 = note: expected type `bool`
810 found type `std::ops::Range<_>`
812 error[E0308]: mismatched types
813 --> $DIR/disallowed-positions.rs:135:11
815 LL | while let Range { start: _, end: _ } = true..true || false {}
816 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
818 = note: expected type `bool`
819 found type `std::ops::Range<bool>`
821 error[E0308]: mismatched types
822 --> $DIR/disallowed-positions.rs:142:15
824 LL | while let Range { start: F, end } = F..|| true {}
825 | ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found struct `std::ops::Range`
827 = note: expected type `fn() -> bool`
828 found type `std::ops::Range<_>`
830 error[E0308]: mismatched types
831 --> $DIR/disallowed-positions.rs:142:44
833 LL | while let Range { start: F, end } = F..|| true {}
834 | ^^^^^^^ expected bool, found closure
836 = note: expected type `bool`
837 found type `[closure@$DIR/disallowed-positions.rs:142:44: 142:51]`
839 error[E0308]: mismatched types
840 --> $DIR/disallowed-positions.rs:142:11
842 LL | while let Range { start: F, end } = F..|| true {}
843 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
845 = note: expected type `bool`
846 found type `std::ops::Range<bool>`
848 error[E0308]: mismatched types
849 --> $DIR/disallowed-positions.rs:150:15
851 LL | while let Range { start: true, end } = t..&&false {}
852 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this match expression has type `bool`
854 | expected bool, found struct `std::ops::Range`
856 = note: expected type `bool`
857 found type `std::ops::Range<_>`
859 error[E0308]: mismatched types
860 --> $DIR/disallowed-positions.rs:150:47
862 LL | while let Range { start: true, end } = t..&&false {}
863 | ^^^^^^^ expected bool, found &&bool
865 = note: expected type `bool`
868 error[E0308]: mismatched types
869 --> $DIR/disallowed-positions.rs:150:11
871 LL | while let Range { start: true, end } = t..&&false {}
872 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
874 = note: expected type `bool`
875 found type `std::ops::Range<bool>`
877 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
878 --> $DIR/disallowed-positions.rs:106:23
880 LL | while let 0 = 0? {}
881 | ^^ the `?` operator cannot be applied to type `{integer}`
883 = help: the trait `std::ops::Try` is not implemented for `{integer}`
884 = note: required by `std::ops::Try::into_result`
886 error[E0614]: type `bool` cannot be dereferenced
887 --> $DIR/disallowed-positions.rs:173:5
892 error[E0600]: cannot apply unary operator `-` to type `bool`
893 --> $DIR/disallowed-positions.rs:175:5
896 | ^^^^^^^^^^ cannot apply unary operator `-`
898 = note: an implementation of `std::ops::Neg` might be missing for `bool`
900 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
901 --> $DIR/disallowed-positions.rs:183:5
904 | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
906 = help: the trait `std::ops::Try` is not implemented for `bool`
907 = note: required by `std::ops::Try::into_result`
909 error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
910 --> $DIR/disallowed-positions.rs:183:5
913 | ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
915 = help: the trait `std::ops::Try` is not implemented for `()`
916 = note: required by `std::ops::Try::from_error`
918 error[E0308]: mismatched types
919 --> $DIR/disallowed-positions.rs:198:10
921 LL | (let Range { start: _, end: _ } = true..true || false);
922 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
924 | expected bool, found struct `std::ops::Range`
926 = note: expected type `bool`
927 found type `std::ops::Range<_>`
929 error[E0308]: mismatched types
930 --> $DIR/disallowed-positions.rs:207:5
932 LL | fn outside_if_and_while_expr() {
933 | - help: try adding a return type: `-> &bool`
936 | ^^^^^^^^^^ expected (), found &bool
938 = note: expected type `()`
941 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
942 --> $DIR/disallowed-positions.rs:179:17
945 | ^^ the `?` operator cannot be applied to type `{integer}`
947 = help: the trait `std::ops::Try` is not implemented for `{integer}`
948 = note: required by `std::ops::Try::into_result`
950 error[E0019]: constant contains unimplemented expression type
951 --> $DIR/disallowed-positions.rs:218:25
953 LL | true && let 1 = 1
956 error[E0019]: constant contains unimplemented expression type
957 --> $DIR/disallowed-positions.rs:218:21
959 LL | true && let 1 = 1
962 error[E0019]: constant contains unimplemented expression type
963 --> $DIR/disallowed-positions.rs:224:25
965 LL | true && let 1 = 1
968 error[E0019]: constant contains unimplemented expression type
969 --> $DIR/disallowed-positions.rs:224:21
971 LL | true && let 1 = 1
974 error[E0019]: constant contains unimplemented expression type
975 --> $DIR/disallowed-positions.rs:230:25
977 LL | true && let 1 = 1
980 error[E0019]: constant contains unimplemented expression type
981 --> $DIR/disallowed-positions.rs:230:21
983 LL | true && let 1 = 1
986 error: aborting due to 109 previous errors
988 Some errors have detailed explanations: E0019, E0277, E0308, E0600, E0614.
989 For more information about an error, try `rustc --explain E0019`.