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 error[E0614]: type `bool` cannot be dereferenced
544 --> $DIR/disallowed-positions.rs:36:8
546 LL | if *let 0 = 0 {}
549 error[E0600]: cannot apply unary operator `-` to type `bool`
550 --> $DIR/disallowed-positions.rs:38:8
552 LL | if -let 0 = 0 {}
553 | ^^^^^^^^^^ cannot apply unary operator `-`
555 = note: an implementation of `std::ops::Neg` might be missing for `bool`
557 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
558 --> $DIR/disallowed-positions.rs:46:8
560 LL | if (let 0 = 0)? {}
561 | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
563 = help: the trait `std::ops::Try` is not implemented for `bool`
564 = note: required by `std::ops::Try::into_result`
566 error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
567 --> $DIR/disallowed-positions.rs:46:8
569 LL | if (let 0 = 0)? {}
570 | ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
572 = help: the trait `std::ops::Try` is not implemented for `()`
573 = note: required by `std::ops::Try::from_error`
575 error[E0308]: mismatched types
576 --> $DIR/disallowed-positions.rs:56:8
578 LL | if x = let 0 = 0 {}
581 | expected bool, found ()
582 | help: try comparing for equality: `x == let 0 = 0`
584 error[E0308]: mismatched types
585 --> $DIR/disallowed-positions.rs:59:8
587 LL | if true..(let 0 = 0) {}
588 | ^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
590 = note: expected type `bool`
591 found struct `std::ops::Range<bool>`
593 error[E0308]: mismatched types
594 --> $DIR/disallowed-positions.rs:61:8
596 LL | if ..(let 0 = 0) {}
597 | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeTo`
599 = note: expected type `bool`
600 found struct `std::ops::RangeTo<bool>`
602 error[E0308]: mismatched types
603 --> $DIR/disallowed-positions.rs:63:8
605 LL | if (let 0 = 0).. {}
606 | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeFrom`
608 = note: expected type `bool`
609 found struct `std::ops::RangeFrom<bool>`
611 error[E0308]: mismatched types
612 --> $DIR/disallowed-positions.rs:67:12
614 LL | if let Range { start: _, end: _ } = true..true && false {}
615 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
617 | expected bool, found struct `std::ops::Range`
619 = note: expected type `bool`
620 found struct `std::ops::Range<_>`
622 error[E0308]: mismatched types
623 --> $DIR/disallowed-positions.rs:67:8
625 LL | if let Range { start: _, end: _ } = true..true && false {}
626 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
628 = note: expected type `bool`
629 found struct `std::ops::Range<bool>`
631 error[E0308]: mismatched types
632 --> $DIR/disallowed-positions.rs:71:12
634 LL | if let Range { start: _, end: _ } = true..true || false {}
635 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
637 | expected bool, found struct `std::ops::Range`
639 = note: expected type `bool`
640 found struct `std::ops::Range<_>`
642 error[E0308]: mismatched types
643 --> $DIR/disallowed-positions.rs:71:8
645 LL | if let Range { start: _, end: _ } = true..true || false {}
646 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
648 = note: expected type `bool`
649 found struct `std::ops::Range<bool>`
651 error[E0308]: mismatched types
652 --> $DIR/disallowed-positions.rs:78:12
654 LL | if let Range { start: F, end } = F..|| true {}
655 | ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found struct `std::ops::Range`
657 = note: expected fn pointer `fn() -> bool`
658 found struct `std::ops::Range<_>`
660 error[E0308]: mismatched types
661 --> $DIR/disallowed-positions.rs:78:41
663 LL | if let Range { start: F, end } = F..|| true {}
664 | ^^^^^^^ expected bool, found closure
666 = note: expected type `bool`
667 found closure `[closure@$DIR/disallowed-positions.rs:78:41: 78:48]`
669 error[E0308]: mismatched types
670 --> $DIR/disallowed-positions.rs:78:8
672 LL | if let Range { start: F, end } = F..|| true {}
673 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
675 = note: expected type `bool`
676 found struct `std::ops::Range<bool>`
678 error[E0308]: mismatched types
679 --> $DIR/disallowed-positions.rs:86:12
681 LL | if let Range { start: true, end } = t..&&false {}
682 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this match expression has type `bool`
684 | expected bool, found struct `std::ops::Range`
686 = note: expected type `bool`
687 found struct `std::ops::Range<_>`
689 error[E0308]: mismatched types
690 --> $DIR/disallowed-positions.rs:86:44
692 LL | if let Range { start: true, end } = t..&&false {}
693 | ^^^^^^^ expected bool, found &&bool
695 error[E0308]: mismatched types
696 --> $DIR/disallowed-positions.rs:86:8
698 LL | if let Range { start: true, end } = t..&&false {}
699 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
701 = note: expected type `bool`
702 found struct `std::ops::Range<bool>`
704 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
705 --> $DIR/disallowed-positions.rs:42:20
707 LL | if let 0 = 0? {}
708 | ^^ the `?` operator cannot be applied to type `{integer}`
710 = help: the trait `std::ops::Try` is not implemented for `{integer}`
711 = note: required by `std::ops::Try::into_result`
713 error[E0308]: mismatched types
714 --> $DIR/disallowed-positions.rs:96:11
716 LL | while &let 0 = 0 {}
719 | expected bool, found &bool
720 | help: consider removing the borrow: `let 0 = 0`
722 error[E0614]: type `bool` cannot be dereferenced
723 --> $DIR/disallowed-positions.rs:100:11
725 LL | while *let 0 = 0 {}
728 error[E0600]: cannot apply unary operator `-` to type `bool`
729 --> $DIR/disallowed-positions.rs:102:11
731 LL | while -let 0 = 0 {}
732 | ^^^^^^^^^^ cannot apply unary operator `-`
734 = note: an implementation of `std::ops::Neg` might be missing for `bool`
736 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
737 --> $DIR/disallowed-positions.rs:110:11
739 LL | while (let 0 = 0)? {}
740 | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
742 = help: the trait `std::ops::Try` is not implemented for `bool`
743 = note: required by `std::ops::Try::into_result`
745 error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
746 --> $DIR/disallowed-positions.rs:110:11
748 LL | while (let 0 = 0)? {}
749 | ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
751 = help: the trait `std::ops::Try` is not implemented for `()`
752 = note: required by `std::ops::Try::from_error`
754 error[E0308]: mismatched types
755 --> $DIR/disallowed-positions.rs:120:11
757 LL | while x = let 0 = 0 {}
760 | expected bool, found ()
761 | help: try comparing for equality: `x == let 0 = 0`
763 error[E0308]: mismatched types
764 --> $DIR/disallowed-positions.rs:123:11
766 LL | while true..(let 0 = 0) {}
767 | ^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
769 = note: expected type `bool`
770 found struct `std::ops::Range<bool>`
772 error[E0308]: mismatched types
773 --> $DIR/disallowed-positions.rs:125:11
775 LL | while ..(let 0 = 0) {}
776 | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeTo`
778 = note: expected type `bool`
779 found struct `std::ops::RangeTo<bool>`
781 error[E0308]: mismatched types
782 --> $DIR/disallowed-positions.rs:127:11
784 LL | while (let 0 = 0).. {}
785 | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeFrom`
787 = note: expected type `bool`
788 found struct `std::ops::RangeFrom<bool>`
790 error[E0308]: mismatched types
791 --> $DIR/disallowed-positions.rs:131:15
793 LL | while let Range { start: _, end: _ } = true..true && false {}
794 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
796 | expected bool, found struct `std::ops::Range`
798 = note: expected type `bool`
799 found struct `std::ops::Range<_>`
801 error[E0308]: mismatched types
802 --> $DIR/disallowed-positions.rs:131:11
804 LL | while let Range { start: _, end: _ } = true..true && false {}
805 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
807 = note: expected type `bool`
808 found struct `std::ops::Range<bool>`
810 error[E0308]: mismatched types
811 --> $DIR/disallowed-positions.rs:135:15
813 LL | while let Range { start: _, end: _ } = true..true || false {}
814 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
816 | expected bool, found struct `std::ops::Range`
818 = note: expected type `bool`
819 found struct `std::ops::Range<_>`
821 error[E0308]: mismatched types
822 --> $DIR/disallowed-positions.rs:135:11
824 LL | while let Range { start: _, end: _ } = true..true || false {}
825 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
827 = note: expected type `bool`
828 found struct `std::ops::Range<bool>`
830 error[E0308]: mismatched types
831 --> $DIR/disallowed-positions.rs:142:15
833 LL | while let Range { start: F, end } = F..|| true {}
834 | ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found struct `std::ops::Range`
836 = note: expected fn pointer `fn() -> bool`
837 found struct `std::ops::Range<_>`
839 error[E0308]: mismatched types
840 --> $DIR/disallowed-positions.rs:142:44
842 LL | while let Range { start: F, end } = F..|| true {}
843 | ^^^^^^^ expected bool, found closure
845 = note: expected type `bool`
846 found closure `[closure@$DIR/disallowed-positions.rs:142:44: 142:51]`
848 error[E0308]: mismatched types
849 --> $DIR/disallowed-positions.rs:142:11
851 LL | while let Range { start: F, end } = F..|| true {}
852 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
854 = note: expected type `bool`
855 found struct `std::ops::Range<bool>`
857 error[E0308]: mismatched types
858 --> $DIR/disallowed-positions.rs:150:15
860 LL | while let Range { start: true, end } = t..&&false {}
861 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this match expression has type `bool`
863 | expected bool, found struct `std::ops::Range`
865 = note: expected type `bool`
866 found struct `std::ops::Range<_>`
868 error[E0308]: mismatched types
869 --> $DIR/disallowed-positions.rs:150:47
871 LL | while let Range { start: true, end } = t..&&false {}
872 | ^^^^^^^ expected bool, found &&bool
874 error[E0308]: mismatched types
875 --> $DIR/disallowed-positions.rs:150:11
877 LL | while let Range { start: true, end } = t..&&false {}
878 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
880 = note: expected type `bool`
881 found struct `std::ops::Range<bool>`
883 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
884 --> $DIR/disallowed-positions.rs:106:23
886 LL | while let 0 = 0? {}
887 | ^^ the `?` operator cannot be applied to type `{integer}`
889 = help: the trait `std::ops::Try` is not implemented for `{integer}`
890 = note: required by `std::ops::Try::into_result`
892 error[E0614]: type `bool` cannot be dereferenced
893 --> $DIR/disallowed-positions.rs:173:5
898 error[E0600]: cannot apply unary operator `-` to type `bool`
899 --> $DIR/disallowed-positions.rs:175:5
902 | ^^^^^^^^^^ cannot apply unary operator `-`
904 = note: an implementation of `std::ops::Neg` might be missing for `bool`
906 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
907 --> $DIR/disallowed-positions.rs:183:5
910 | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
912 = help: the trait `std::ops::Try` is not implemented for `bool`
913 = note: required by `std::ops::Try::into_result`
915 error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
916 --> $DIR/disallowed-positions.rs:183:5
919 | ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
921 = help: the trait `std::ops::Try` is not implemented for `()`
922 = note: required by `std::ops::Try::from_error`
924 error[E0308]: mismatched types
925 --> $DIR/disallowed-positions.rs:198:10
927 LL | (let Range { start: _, end: _ } = true..true || false);
928 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
930 | expected bool, found struct `std::ops::Range`
932 = note: expected type `bool`
933 found struct `std::ops::Range<_>`
935 error[E0308]: mismatched types
936 --> $DIR/disallowed-positions.rs:207:5
938 LL | fn outside_if_and_while_expr() {
939 | - help: try adding a return type: `-> &bool`
942 | ^^^^^^^^^^ expected (), found &bool
944 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
945 --> $DIR/disallowed-positions.rs:179:17
948 | ^^ the `?` operator cannot be applied to type `{integer}`
950 = help: the trait `std::ops::Try` is not implemented for `{integer}`
951 = note: required by `std::ops::Try::into_result`
953 error: aborting due to 106 previous errors
955 Some errors have detailed explanations: E0277, E0308, E0600, E0614, E0744.
956 For more information about an error, try `rustc --explain E0277`.