1 error: expressions must be enclosed in braces to be used as const generic arguments
2 --> $DIR/disallowed-positions.rs:236:9
7 help: enclose the `const` expression in braces
9 LL | { true && let 1 = 1 }
12 error: `let` expressions are not supported here
13 --> $DIR/disallowed-positions.rs:32:9
18 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
20 error: `let` expressions are not supported here
21 --> $DIR/disallowed-positions.rs:35:9
26 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
28 error: `let` expressions are not supported here
29 --> $DIR/disallowed-positions.rs:36:9
34 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
36 error: `let` expressions are not supported here
37 --> $DIR/disallowed-positions.rs:38:9
42 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
44 error: `let` expressions are not supported here
45 --> $DIR/disallowed-positions.rs:46:9
47 LL | if (let 0 = 0)? {}
50 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
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 without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
60 error: `let` expressions are not supported here
61 --> $DIR/disallowed-positions.rs:51:17
63 LL | if (true || let 0 = 0) {}
66 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
68 error: `let` expressions are not supported here
69 --> $DIR/disallowed-positions.rs:52:25
71 LL | if true && (true || let 0 = 0) {}
74 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
76 error: `let` expressions are not supported here
77 --> $DIR/disallowed-positions.rs:53:25
79 LL | if true || (true && let 0 = 0) {}
82 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
84 error: `let` expressions are not supported here
85 --> $DIR/disallowed-positions.rs:56:12
87 LL | if x = let 0 = 0 {}
90 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
92 error: `let` expressions are not supported here
93 --> $DIR/disallowed-positions.rs:59:15
95 LL | if true..(let 0 = 0) {}
98 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
100 error: `let` expressions are not supported here
101 --> $DIR/disallowed-positions.rs:61:11
103 LL | if ..(let 0 = 0) {}
106 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
108 error: `let` expressions are not supported here
109 --> $DIR/disallowed-positions.rs:63:9
111 LL | if (let 0 = 0).. {}
114 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
116 error: `let` expressions are not supported here
117 --> $DIR/disallowed-positions.rs:67:8
119 LL | if let Range { start: _, end: _ } = true..true && false {}
120 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
122 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
124 error: `let` expressions are not supported here
125 --> $DIR/disallowed-positions.rs:71:8
127 LL | if let Range { start: _, end: _ } = true..true || false {}
128 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
130 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
132 error: `let` expressions are not supported here
133 --> $DIR/disallowed-positions.rs:78:8
135 LL | if let Range { start: F, end } = F..|| true {}
136 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
138 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
140 error: `let` expressions are not supported here
141 --> $DIR/disallowed-positions.rs:86:8
143 LL | if let Range { start: true, end } = t..&&false {}
144 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
146 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
148 error: `let` expressions are not supported here
149 --> $DIR/disallowed-positions.rs:92:19
151 LL | if let true = let true = true {}
154 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
156 error: `let` expressions are not supported here
157 --> $DIR/disallowed-positions.rs:96:12
159 LL | while &let 0 = 0 {}
162 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
164 error: `let` expressions are not supported here
165 --> $DIR/disallowed-positions.rs:99:12
167 LL | while !let 0 = 0 {}
170 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
172 error: `let` expressions are not supported here
173 --> $DIR/disallowed-positions.rs:100:12
175 LL | while *let 0 = 0 {}
178 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
180 error: `let` expressions are not supported here
181 --> $DIR/disallowed-positions.rs:102:12
183 LL | while -let 0 = 0 {}
186 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
188 error: `let` expressions are not supported here
189 --> $DIR/disallowed-positions.rs:110:12
191 LL | while (let 0 = 0)? {}
194 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
196 error: `let` expressions are not supported here
197 --> $DIR/disallowed-positions.rs:114:19
199 LL | while true || let 0 = 0 {}
202 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
204 error: `let` expressions are not supported here
205 --> $DIR/disallowed-positions.rs:115:20
207 LL | while (true || let 0 = 0) {}
210 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
212 error: `let` expressions are not supported here
213 --> $DIR/disallowed-positions.rs:116:28
215 LL | while true && (true || let 0 = 0) {}
218 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
220 error: `let` expressions are not supported here
221 --> $DIR/disallowed-positions.rs:117:28
223 LL | while true || (true && let 0 = 0) {}
226 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
228 error: `let` expressions are not supported here
229 --> $DIR/disallowed-positions.rs:120:15
231 LL | while x = let 0 = 0 {}
234 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
236 error: `let` expressions are not supported here
237 --> $DIR/disallowed-positions.rs:123:18
239 LL | while true..(let 0 = 0) {}
242 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
244 error: `let` expressions are not supported here
245 --> $DIR/disallowed-positions.rs:125:14
247 LL | while ..(let 0 = 0) {}
250 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
252 error: `let` expressions are not supported here
253 --> $DIR/disallowed-positions.rs:127:12
255 LL | while (let 0 = 0).. {}
258 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
260 error: `let` expressions are not supported here
261 --> $DIR/disallowed-positions.rs:131:11
263 LL | while let Range { start: _, end: _ } = true..true && false {}
264 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
266 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
268 error: `let` expressions are not supported here
269 --> $DIR/disallowed-positions.rs:135:11
271 LL | while let Range { start: _, end: _ } = true..true || false {}
272 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
274 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
276 error: `let` expressions are not supported here
277 --> $DIR/disallowed-positions.rs:142:11
279 LL | while let Range { start: F, end } = F..|| true {}
280 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
282 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
284 error: `let` expressions are not supported here
285 --> $DIR/disallowed-positions.rs:150:11
287 LL | while let Range { start: true, end } = t..&&false {}
288 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
290 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
292 error: `let` expressions are not supported here
293 --> $DIR/disallowed-positions.rs:156:22
295 LL | while let true = let true = true {}
298 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
300 error: `let` expressions are not supported here
301 --> $DIR/disallowed-positions.rs:170:6
306 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
308 error: `let` expressions are not supported here
309 --> $DIR/disallowed-positions.rs:172:6
314 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
316 error: `let` expressions are not supported here
317 --> $DIR/disallowed-positions.rs:173:6
322 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
324 error: `let` expressions are not supported here
325 --> $DIR/disallowed-positions.rs:175:6
330 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
332 error: `let` expressions are not supported here
333 --> $DIR/disallowed-positions.rs:183:6
338 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
340 error: `let` expressions are not supported here
341 --> $DIR/disallowed-positions.rs:187:13
343 LL | true || let 0 = 0;
346 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
348 error: `let` expressions are not supported here
349 --> $DIR/disallowed-positions.rs:188:14
351 LL | (true || let 0 = 0);
354 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
356 error: `let` expressions are not supported here
357 --> $DIR/disallowed-positions.rs:189:22
359 LL | true && (true || let 0 = 0);
362 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
364 error: `let` expressions are not supported here
365 --> $DIR/disallowed-positions.rs:192:9
370 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
372 error: `let` expressions are not supported here
373 --> $DIR/disallowed-positions.rs:194:12
375 LL | true..(let 0 = 0);
378 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
380 error: `let` expressions are not supported here
381 --> $DIR/disallowed-positions.rs:195:8
386 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
388 error: `let` expressions are not supported here
389 --> $DIR/disallowed-positions.rs:196:6
394 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
396 error: `let` expressions are not supported here
397 --> $DIR/disallowed-positions.rs:198:6
399 LL | (let Range { start: _, end: _ } = true..true || false);
400 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
402 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
404 error: `let` expressions are not supported here
405 --> $DIR/disallowed-positions.rs:202:6
407 LL | (let true = let true = true);
408 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
410 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
412 error: `let` expressions are not supported here
413 --> $DIR/disallowed-positions.rs:202:17
415 LL | (let true = let true = true);
418 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
420 error: `let` expressions are not supported here
421 --> $DIR/disallowed-positions.rs:207:6
426 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
428 error: `let` expressions are not supported here
429 --> $DIR/disallowed-positions.rs:218:17
431 LL | true && let 1 = 1
434 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
436 error: `let` expressions are not supported here
437 --> $DIR/disallowed-positions.rs:222:17
439 LL | true && let 1 = 1
442 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
444 error: `let` expressions are not supported here
445 --> $DIR/disallowed-positions.rs:226:17
447 LL | true && let 1 = 1
450 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
452 error: `let` expressions are not supported here
453 --> $DIR/disallowed-positions.rs:236:17
455 LL | true && let 1 = 1
458 = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
460 warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
461 --> $DIR/disallowed-positions.rs:20:12
463 LL | #![feature(const_generics)]
466 = note: `#[warn(incomplete_features)]` on by default
467 = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
469 warning: the feature `let_chains` is incomplete and may not be safe to use and/or cause compiler crashes
470 --> $DIR/disallowed-positions.rs:22:12
472 LL | #![feature(let_chains)] // Avoid inflating `.stderr` with overzealous gates in this test.
475 = note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
477 error[E0308]: mismatched types
478 --> $DIR/disallowed-positions.rs:32:8
480 LL | if &let 0 = 0 {}
483 | expected `bool`, found `&bool`
484 | help: consider removing the borrow: `let 0 = 0`
486 error[E0614]: type `bool` cannot be dereferenced
487 --> $DIR/disallowed-positions.rs:36:8
489 LL | if *let 0 = 0 {}
492 error[E0600]: cannot apply unary operator `-` to type `bool`
493 --> $DIR/disallowed-positions.rs:38:8
495 LL | if -let 0 = 0 {}
496 | ^^^^^^^^^^ cannot apply unary operator `-`
498 error[E0277]: the `?` operator can only be applied to values that implement `Try`
499 --> $DIR/disallowed-positions.rs:46:8
501 LL | if (let 0 = 0)? {}
502 | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
504 = help: the trait `Try` is not implemented for `bool`
505 = note: required by `branch`
507 error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
508 --> $DIR/disallowed-positions.rs:46:19
510 LL | / fn nested_within_if_expr() {
511 LL | | if &let 0 = 0 {}
515 LL | | if (let 0 = 0)? {}
516 | | ^ cannot use the `?` operator in a function that returns `()`
518 LL | | if let true = let true = true {}
520 | |_- this function should return `Result` or `Option` to accept `?`
522 = help: the trait `FromResidual<_>` is not implemented for `()`
523 = note: required by `from_residual`
525 error[E0308]: mismatched types
526 --> $DIR/disallowed-positions.rs:56:8
528 LL | if x = let 0 = 0 {}
529 | ^^^^^^^^^^^^^ expected `bool`, found `()`
531 help: you might have meant to compare for equality
533 LL | if x == let 0 = 0 {}
536 error[E0308]: mismatched types
537 --> $DIR/disallowed-positions.rs:59:8
539 LL | if true..(let 0 = 0) {}
540 | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
542 = note: expected type `bool`
543 found struct `std::ops::Range<bool>`
545 error[E0308]: mismatched types
546 --> $DIR/disallowed-positions.rs:61:8
548 LL | if ..(let 0 = 0) {}
549 | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeTo`
551 = note: expected type `bool`
552 found struct `RangeTo<bool>`
554 error[E0308]: mismatched types
555 --> $DIR/disallowed-positions.rs:63:8
557 LL | if (let 0 = 0).. {}
558 | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeFrom`
560 = note: expected type `bool`
561 found struct `RangeFrom<bool>`
563 error[E0308]: mismatched types
564 --> $DIR/disallowed-positions.rs:67:12
566 LL | if let Range { start: _, end: _ } = true..true && false {}
567 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
569 | expected `bool`, found struct `std::ops::Range`
571 = note: expected type `bool`
572 found struct `std::ops::Range<_>`
574 error[E0308]: mismatched types
575 --> $DIR/disallowed-positions.rs:67:8
577 LL | if let Range { start: _, end: _ } = true..true && false {}
578 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
580 = note: expected type `bool`
581 found struct `std::ops::Range<bool>`
583 error[E0308]: mismatched types
584 --> $DIR/disallowed-positions.rs:71:12
586 LL | if let Range { start: _, end: _ } = true..true || false {}
587 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
589 | expected `bool`, found struct `std::ops::Range`
591 = note: expected type `bool`
592 found struct `std::ops::Range<_>`
594 error[E0308]: mismatched types
595 --> $DIR/disallowed-positions.rs:71:8
597 LL | if let Range { start: _, end: _ } = true..true || false {}
598 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
600 = note: expected type `bool`
601 found struct `std::ops::Range<bool>`
603 error[E0308]: mismatched types
604 --> $DIR/disallowed-positions.rs:78:12
606 LL | if let Range { start: F, end } = F..|| true {}
607 | ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found struct `std::ops::Range`
609 = note: expected fn pointer `fn() -> bool`
610 found struct `std::ops::Range<_>`
612 error[E0308]: mismatched types
613 --> $DIR/disallowed-positions.rs:78:41
615 LL | if let Range { start: F, end } = F..|| true {}
616 | ^^^^^^^ expected `bool`, found closure
618 = note: expected type `bool`
619 found closure `[closure@$DIR/disallowed-positions.rs:78:41: 78:48]`
621 error[E0308]: mismatched types
622 --> $DIR/disallowed-positions.rs:78:8
624 LL | if let Range { start: F, end } = F..|| true {}
625 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
627 = note: expected type `bool`
628 found struct `std::ops::Range<bool>`
630 error[E0308]: mismatched types
631 --> $DIR/disallowed-positions.rs:86:12
633 LL | if let Range { start: true, end } = t..&&false {}
634 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool`
636 | expected `bool`, found struct `std::ops::Range`
638 = note: expected type `bool`
639 found struct `std::ops::Range<_>`
641 error[E0308]: mismatched types
642 --> $DIR/disallowed-positions.rs:86:44
644 LL | if let Range { start: true, end } = t..&&false {}
645 | ^^^^^^^ expected `bool`, found `&&bool`
647 error[E0308]: mismatched types
648 --> $DIR/disallowed-positions.rs:86:8
650 LL | if let Range { start: true, end } = t..&&false {}
651 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
653 = note: expected type `bool`
654 found struct `std::ops::Range<bool>`
656 error[E0277]: the `?` operator can only be applied to values that implement `Try`
657 --> $DIR/disallowed-positions.rs:42:20
659 LL | if let 0 = 0? {}
660 | ^^ the `?` operator cannot be applied to type `{integer}`
662 = help: the trait `Try` is not implemented for `{integer}`
663 = note: required by `branch`
665 error[E0308]: mismatched types
666 --> $DIR/disallowed-positions.rs:96:11
668 LL | while &let 0 = 0 {}
671 | expected `bool`, found `&bool`
672 | help: consider removing the borrow: `let 0 = 0`
674 error[E0614]: type `bool` cannot be dereferenced
675 --> $DIR/disallowed-positions.rs:100:11
677 LL | while *let 0 = 0 {}
680 error[E0600]: cannot apply unary operator `-` to type `bool`
681 --> $DIR/disallowed-positions.rs:102:11
683 LL | while -let 0 = 0 {}
684 | ^^^^^^^^^^ cannot apply unary operator `-`
686 error[E0277]: the `?` operator can only be applied to values that implement `Try`
687 --> $DIR/disallowed-positions.rs:110:11
689 LL | while (let 0 = 0)? {}
690 | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
692 = help: the trait `Try` is not implemented for `bool`
693 = note: required by `branch`
695 error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
696 --> $DIR/disallowed-positions.rs:110:22
698 LL | / fn nested_within_while_expr() {
699 LL | | while &let 0 = 0 {}
703 LL | | while (let 0 = 0)? {}
704 | | ^ cannot use the `?` operator in a function that returns `()`
706 LL | | while let true = let true = true {}
708 | |_- this function should return `Result` or `Option` to accept `?`
710 = help: the trait `FromResidual<_>` is not implemented for `()`
711 = note: required by `from_residual`
713 error[E0308]: mismatched types
714 --> $DIR/disallowed-positions.rs:120:11
716 LL | while x = let 0 = 0 {}
717 | ^^^^^^^^^^^^^ expected `bool`, found `()`
719 help: you might have meant to compare for equality
721 LL | while x == let 0 = 0 {}
724 error[E0308]: mismatched types
725 --> $DIR/disallowed-positions.rs:123:11
727 LL | while true..(let 0 = 0) {}
728 | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
730 = note: expected type `bool`
731 found struct `std::ops::Range<bool>`
733 error[E0308]: mismatched types
734 --> $DIR/disallowed-positions.rs:125:11
736 LL | while ..(let 0 = 0) {}
737 | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeTo`
739 = note: expected type `bool`
740 found struct `RangeTo<bool>`
742 error[E0308]: mismatched types
743 --> $DIR/disallowed-positions.rs:127:11
745 LL | while (let 0 = 0).. {}
746 | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeFrom`
748 = note: expected type `bool`
749 found struct `RangeFrom<bool>`
751 error[E0308]: mismatched types
752 --> $DIR/disallowed-positions.rs:131:15
754 LL | while let Range { start: _, end: _ } = true..true && false {}
755 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
757 | expected `bool`, found struct `std::ops::Range`
759 = note: expected type `bool`
760 found struct `std::ops::Range<_>`
762 error[E0308]: mismatched types
763 --> $DIR/disallowed-positions.rs:131:11
765 LL | while let Range { start: _, end: _ } = true..true && false {}
766 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
768 = note: expected type `bool`
769 found struct `std::ops::Range<bool>`
771 error[E0308]: mismatched types
772 --> $DIR/disallowed-positions.rs:135:15
774 LL | while let Range { start: _, end: _ } = true..true || false {}
775 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
777 | expected `bool`, found struct `std::ops::Range`
779 = note: expected type `bool`
780 found struct `std::ops::Range<_>`
782 error[E0308]: mismatched types
783 --> $DIR/disallowed-positions.rs:135:11
785 LL | while let Range { start: _, end: _ } = true..true || false {}
786 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
788 = note: expected type `bool`
789 found struct `std::ops::Range<bool>`
791 error[E0308]: mismatched types
792 --> $DIR/disallowed-positions.rs:142:15
794 LL | while let Range { start: F, end } = F..|| true {}
795 | ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found struct `std::ops::Range`
797 = note: expected fn pointer `fn() -> bool`
798 found struct `std::ops::Range<_>`
800 error[E0308]: mismatched types
801 --> $DIR/disallowed-positions.rs:142:44
803 LL | while let Range { start: F, end } = F..|| true {}
804 | ^^^^^^^ expected `bool`, found closure
806 = note: expected type `bool`
807 found closure `[closure@$DIR/disallowed-positions.rs:142:44: 142:51]`
809 error[E0308]: mismatched types
810 --> $DIR/disallowed-positions.rs:142:11
812 LL | while let Range { start: F, end } = F..|| true {}
813 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
815 = note: expected type `bool`
816 found struct `std::ops::Range<bool>`
818 error[E0308]: mismatched types
819 --> $DIR/disallowed-positions.rs:150:15
821 LL | while let Range { start: true, end } = t..&&false {}
822 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool`
824 | expected `bool`, found struct `std::ops::Range`
826 = note: expected type `bool`
827 found struct `std::ops::Range<_>`
829 error[E0308]: mismatched types
830 --> $DIR/disallowed-positions.rs:150:47
832 LL | while let Range { start: true, end } = t..&&false {}
833 | ^^^^^^^ expected `bool`, found `&&bool`
835 error[E0308]: mismatched types
836 --> $DIR/disallowed-positions.rs:150:11
838 LL | while let Range { start: true, end } = t..&&false {}
839 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
841 = note: expected type `bool`
842 found struct `std::ops::Range<bool>`
844 error[E0277]: the `?` operator can only be applied to values that implement `Try`
845 --> $DIR/disallowed-positions.rs:106:23
847 LL | while let 0 = 0? {}
848 | ^^ the `?` operator cannot be applied to type `{integer}`
850 = help: the trait `Try` is not implemented for `{integer}`
851 = note: required by `branch`
853 error[E0614]: type `bool` cannot be dereferenced
854 --> $DIR/disallowed-positions.rs:173:5
859 error[E0600]: cannot apply unary operator `-` to type `bool`
860 --> $DIR/disallowed-positions.rs:175:5
863 | ^^^^^^^^^^ cannot apply unary operator `-`
865 error[E0277]: the `?` operator can only be applied to values that implement `Try`
866 --> $DIR/disallowed-positions.rs:183:5
869 | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
871 = help: the trait `Try` is not implemented for `bool`
872 = note: required by `branch`
874 error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
875 --> $DIR/disallowed-positions.rs:183:16
877 LL | / fn outside_if_and_while_expr() {
883 | | ^ cannot use the `?` operator in a function that returns `()`
887 | |_- this function should return `Result` or `Option` to accept `?`
889 = help: the trait `FromResidual<_>` is not implemented for `()`
890 = note: required by `from_residual`
892 error[E0308]: mismatched types
893 --> $DIR/disallowed-positions.rs:198:10
895 LL | (let Range { start: _, end: _ } = true..true || false);
896 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
898 | expected `bool`, found struct `std::ops::Range`
900 = note: expected type `bool`
901 found struct `std::ops::Range<_>`
903 error[E0308]: mismatched types
904 --> $DIR/disallowed-positions.rs:207:5
906 LL | fn outside_if_and_while_expr() {
907 | - help: try adding a return type: `-> &bool`
910 | ^^^^^^^^^^ expected `()`, found `&bool`
912 error[E0277]: the `?` operator can only be applied to values that implement `Try`
913 --> $DIR/disallowed-positions.rs:179:17
916 | ^^ the `?` operator cannot be applied to type `{integer}`
918 = help: the trait `Try` is not implemented for `{integer}`
919 = note: required by `branch`
921 error: aborting due to 104 previous errors; 2 warnings emitted
923 Some errors have detailed explanations: E0277, E0308, E0600, E0614.
924 For more information about an error, try `rustc --explain E0277`.