fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4fb7144ed15

1.43.0
34.7 KiB986 linesraw
1error: expected one of `,` or `>`, found `&&`
2  --> $DIR/disallowed-positions.rs:239:14
3   |
4LL |         true && let 1 = 1
5   |              ^^ expected one of `,` or `>`
6
7error: `let` expressions are not supported here
8  --> $DIR/disallowed-positions.rs:32:9
9   |
10LL |     if &let 0 = 0 {}
11   |         ^^^^^^^^^
12   |
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
15
16error: `let` expressions are not supported here
17  --> $DIR/disallowed-positions.rs:35:9
18   |
19LL |     if !let 0 = 0 {}
20   |         ^^^^^^^^^
21   |
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
24
25error: `let` expressions are not supported here
26  --> $DIR/disallowed-positions.rs:36:9
27   |
28LL |     if *let 0 = 0 {}
29   |         ^^^^^^^^^
30   |
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
33
34error: `let` expressions are not supported here
35  --> $DIR/disallowed-positions.rs:38:9
36   |
37LL |     if -let 0 = 0 {}
38   |         ^^^^^^^^^
39   |
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
42
43error: `let` expressions are not supported here
44  --> $DIR/disallowed-positions.rs:46:9
45   |
46LL |     if (let 0 = 0)? {}
47   |         ^^^^^^^^^
48   |
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
51
52error: `let` expressions are not supported here
53  --> $DIR/disallowed-positions.rs:50:16
54   |
55LL |     if true || let 0 = 0 {}
56   |                ^^^^^^^^^
57   |
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
60
61error: `let` expressions are not supported here
62  --> $DIR/disallowed-positions.rs:51:17
63   |
64LL |     if (true || let 0 = 0) {}
65   |                 ^^^^^^^^^
66   |
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
69
70error: `let` expressions are not supported here
71  --> $DIR/disallowed-positions.rs:52:25
72   |
73LL |     if true && (true || let 0 = 0) {}
74   |                         ^^^^^^^^^
75   |
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
78
79error: `let` expressions are not supported here
80  --> $DIR/disallowed-positions.rs:53:25
81   |
82LL |     if true || (true && let 0 = 0) {}
83   |                         ^^^^^^^^^
84   |
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
87
88error: `let` expressions are not supported here
89  --> $DIR/disallowed-positions.rs:56:12
90   |
91LL |     if x = let 0 = 0 {}
92   |            ^^^^^^^^^
93   |
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
96
97error: `let` expressions are not supported here
98  --> $DIR/disallowed-positions.rs:59:15
99   |
100LL |     if true..(let 0 = 0) {}
101   |               ^^^^^^^^^
102   |
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
105
106error: `let` expressions are not supported here
107  --> $DIR/disallowed-positions.rs:61:11
108   |
109LL |     if ..(let 0 = 0) {}
110   |           ^^^^^^^^^
111   |
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
114
115error: `let` expressions are not supported here
116  --> $DIR/disallowed-positions.rs:63:9
117   |
118LL |     if (let 0 = 0).. {}
119   |         ^^^^^^^^^
120   |
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
123
124error: `let` expressions are not supported here
125  --> $DIR/disallowed-positions.rs:67:8
126   |
127LL |     if let Range { start: _, end: _ } = true..true && false {}
128   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
129   |
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
132
133error: `let` expressions are not supported here
134  --> $DIR/disallowed-positions.rs:71:8
135   |
136LL |     if let Range { start: _, end: _ } = true..true || false {}
137   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
138   |
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
141
142error: `let` expressions are not supported here
143  --> $DIR/disallowed-positions.rs:78:8
144   |
145LL |     if let Range { start: F, end } = F..|| true {}
146   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
147   |
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
150
151error: `let` expressions are not supported here
152  --> $DIR/disallowed-positions.rs:86:8
153   |
154LL |     if let Range { start: true, end } = t..&&false {}
155   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
156   |
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
159
160error: `let` expressions are not supported here
161  --> $DIR/disallowed-positions.rs:92:19
162   |
163LL |     if let true = let true = true {}
164   |                   ^^^^^^^^^^^^^^^
165   |
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
168
169error: `let` expressions are not supported here
170  --> $DIR/disallowed-positions.rs:96:12
171   |
172LL |     while &let 0 = 0 {}
173   |            ^^^^^^^^^
174   |
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
177
178error: `let` expressions are not supported here
179  --> $DIR/disallowed-positions.rs:99:12
180   |
181LL |     while !let 0 = 0 {}
182   |            ^^^^^^^^^
183   |
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
186
187error: `let` expressions are not supported here
188  --> $DIR/disallowed-positions.rs:100:12
189   |
190LL |     while *let 0 = 0 {}
191   |            ^^^^^^^^^
192   |
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
195
196error: `let` expressions are not supported here
197  --> $DIR/disallowed-positions.rs:102:12
198   |
199LL |     while -let 0 = 0 {}
200   |            ^^^^^^^^^
201   |
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
204
205error: `let` expressions are not supported here
206  --> $DIR/disallowed-positions.rs:110:12
207   |
208LL |     while (let 0 = 0)? {}
209   |            ^^^^^^^^^
210   |
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
213
214error: `let` expressions are not supported here
215  --> $DIR/disallowed-positions.rs:114:19
216   |
217LL |     while true || let 0 = 0 {}
218   |                   ^^^^^^^^^
219   |
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
222
223error: `let` expressions are not supported here
224  --> $DIR/disallowed-positions.rs:115:20
225   |
226LL |     while (true || let 0 = 0) {}
227   |                    ^^^^^^^^^
228   |
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
231
232error: `let` expressions are not supported here
233  --> $DIR/disallowed-positions.rs:116:28
234   |
235LL |     while true && (true || let 0 = 0) {}
236   |                            ^^^^^^^^^
237   |
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
240
241error: `let` expressions are not supported here
242  --> $DIR/disallowed-positions.rs:117:28
243   |
244LL |     while true || (true && let 0 = 0) {}
245   |                            ^^^^^^^^^
246   |
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
249
250error: `let` expressions are not supported here
251  --> $DIR/disallowed-positions.rs:120:15
252   |
253LL |     while x = let 0 = 0 {}
254   |               ^^^^^^^^^
255   |
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
258
259error: `let` expressions are not supported here
260  --> $DIR/disallowed-positions.rs:123:18
261   |
262LL |     while true..(let 0 = 0) {}
263   |                  ^^^^^^^^^
264   |
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
267
268error: `let` expressions are not supported here
269  --> $DIR/disallowed-positions.rs:125:14
270   |
271LL |     while ..(let 0 = 0) {}
272   |              ^^^^^^^^^
273   |
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
276
277error: `let` expressions are not supported here
278  --> $DIR/disallowed-positions.rs:127:12
279   |
280LL |     while (let 0 = 0).. {}
281   |            ^^^^^^^^^
282   |
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
285
286error: `let` expressions are not supported here
287  --> $DIR/disallowed-positions.rs:131:11
288   |
289LL |     while let Range { start: _, end: _ } = true..true && false {}
290   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
291   |
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
294
295error: `let` expressions are not supported here
296  --> $DIR/disallowed-positions.rs:135:11
297   |
298LL |     while let Range { start: _, end: _ } = true..true || false {}
299   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
300   |
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
303
304error: `let` expressions are not supported here
305  --> $DIR/disallowed-positions.rs:142:11
306   |
307LL |     while let Range { start: F, end } = F..|| true {}
308   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
309   |
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
312
313error: `let` expressions are not supported here
314  --> $DIR/disallowed-positions.rs:150:11
315   |
316LL |     while let Range { start: true, end } = t..&&false {}
317   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
318   |
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
321
322error: `let` expressions are not supported here
323  --> $DIR/disallowed-positions.rs:156:22
324   |
325LL |     while let true = let true = true {}
326   |                      ^^^^^^^^^^^^^^^
327   |
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
330
331error: `let` expressions are not supported here
332  --> $DIR/disallowed-positions.rs:170:6
333   |
334LL |     &let 0 = 0;
335   |      ^^^^^^^^^
336   |
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
339
340error: `let` expressions are not supported here
341  --> $DIR/disallowed-positions.rs:172:6
342   |
343LL |     !let 0 = 0;
344   |      ^^^^^^^^^
345   |
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
348
349error: `let` expressions are not supported here
350  --> $DIR/disallowed-positions.rs:173:6
351   |
352LL |     *let 0 = 0;
353   |      ^^^^^^^^^
354   |
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
357
358error: `let` expressions are not supported here
359  --> $DIR/disallowed-positions.rs:175:6
360   |
361LL |     -let 0 = 0;
362   |      ^^^^^^^^^
363   |
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
366
367error: `let` expressions are not supported here
368  --> $DIR/disallowed-positions.rs:183:6
369   |
370LL |     (let 0 = 0)?;
371   |      ^^^^^^^^^
372   |
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
375
376error: `let` expressions are not supported here
377  --> $DIR/disallowed-positions.rs:187:13
378   |
379LL |     true || let 0 = 0;
380   |             ^^^^^^^^^
381   |
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
384
385error: `let` expressions are not supported here
386  --> $DIR/disallowed-positions.rs:188:14
387   |
388LL |     (true || let 0 = 0);
389   |              ^^^^^^^^^
390   |
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
393
394error: `let` expressions are not supported here
395  --> $DIR/disallowed-positions.rs:189:22
396   |
397LL |     true && (true || let 0 = 0);
398   |                      ^^^^^^^^^
399   |
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
402
403error: `let` expressions are not supported here
404  --> $DIR/disallowed-positions.rs:192:9
405   |
406LL |     x = let 0 = 0;
407   |         ^^^^^^^^^
408   |
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
411
412error: `let` expressions are not supported here
413  --> $DIR/disallowed-positions.rs:194:12
414   |
415LL |     true..(let 0 = 0);
416   |            ^^^^^^^^^
417   |
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
420
421error: `let` expressions are not supported here
422  --> $DIR/disallowed-positions.rs:195:8
423   |
424LL |     ..(let 0 = 0);
425   |        ^^^^^^^^^
426   |
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
429
430error: `let` expressions are not supported here
431  --> $DIR/disallowed-positions.rs:196:6
432   |
433LL |     (let 0 = 0)..;
434   |      ^^^^^^^^^
435   |
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
438
439error: `let` expressions are not supported here
440  --> $DIR/disallowed-positions.rs:198:6
441   |
442LL |     (let Range { start: _, end: _ } = true..true || false);
443   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
444   |
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
447
448error: `let` expressions are not supported here
449  --> $DIR/disallowed-positions.rs:202:6
450   |
451LL |     (let true = let true = true);
452   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^
453   |
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
456
457error: `let` expressions are not supported here
458  --> $DIR/disallowed-positions.rs:202:17
459   |
460LL |     (let true = let true = true);
461   |                 ^^^^^^^^^^^^^^^
462   |
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
465
466error: `let` expressions are not supported here
467  --> $DIR/disallowed-positions.rs:207:6
468   |
469LL |     &let 0 = 0
470   |      ^^^^^^^^^
471   |
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
474
475error: `let` expressions are not supported here
476  --> $DIR/disallowed-positions.rs:218:17
477   |
478LL |         true && let 1 = 1
479   |                 ^^^^^^^^^
480   |
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
483
484error: `let` expressions are not supported here
485  --> $DIR/disallowed-positions.rs:223:17
486   |
487LL |         true && let 1 = 1
488   |                 ^^^^^^^^^
489   |
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
492
493error: `let` expressions are not supported here
494  --> $DIR/disallowed-positions.rs:228:17
495   |
496LL |         true && let 1 = 1
497   |                 ^^^^^^^^^
498   |
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
501
502warning: the feature `const_generics` is incomplete and may cause the compiler to crash
503  --> $DIR/disallowed-positions.rs:20:12
504   |
505LL | #![feature(const_generics)]
506   |            ^^^^^^^^^^^^^^
507   |
508   = note: `#[warn(incomplete_features)]` on by default
509
510warning: the feature `let_chains` is incomplete and may cause the compiler to crash
511  --> $DIR/disallowed-positions.rs:22:12
512   |
513LL | #![feature(let_chains)] // Avoid inflating `.stderr` with overzealous gates in this test.
514   |            ^^^^^^^^^^
515
516error[E0658]: `match` is not allowed in a `const`
517  --> $DIR/disallowed-positions.rs:218:17
518   |
519LL |         true && let 1 = 1
520   |                 ^^^^^^^^^
521   |
522   = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information
523   = help: add `#![feature(const_if_match)]` to the crate attributes to enable
524
525error[E0658]: `match` is not allowed in a `const`
526  --> $DIR/disallowed-positions.rs:223:17
527   |
528LL |         true && let 1 = 1
529   |                 ^^^^^^^^^
530   |
531   = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information
532   = help: add `#![feature(const_if_match)]` to the crate attributes to enable
533
534error[E0658]: `match` is not allowed in a `const`
535  --> $DIR/disallowed-positions.rs:228:17
536   |
537LL |         true && let 1 = 1
538   |                 ^^^^^^^^^
539   |
540   = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information
541   = help: add `#![feature(const_if_match)]` to the crate attributes to enable
542
543error[E0308]: mismatched types
544  --> $DIR/disallowed-positions.rs:32:8
545   |
546LL |     if &let 0 = 0 {}
547   |        ^^^^^^^^^^
548   |        |
549   |        expected `bool`, found `&bool`
550   |        help: consider removing the borrow: `let 0 = 0`
551
552error[E0614]: type `bool` cannot be dereferenced
553  --> $DIR/disallowed-positions.rs:36:8
554   |
555LL |     if *let 0 = 0 {}
556   |        ^^^^^^^^^^
557
558error[E0600]: cannot apply unary operator `-` to type `bool`
559  --> $DIR/disallowed-positions.rs:38:8
560   |
561LL |     if -let 0 = 0 {}
562   |        ^^^^^^^^^^ cannot apply unary operator `-`
563
564error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
565  --> $DIR/disallowed-positions.rs:46:8
566   |
567LL |     if (let 0 = 0)? {}
568   |        ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
569   |
570   = help: the trait `std::ops::Try` is not implemented for `bool`
571   = note: required by `std::ops::Try::into_result`
572
573error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
574  --> $DIR/disallowed-positions.rs:46:8
575   |
576LL | / fn nested_within_if_expr() {
577LL | |     if &let 0 = 0 {}
578LL | |
579LL | |
580...  |
581LL | |     if (let 0 = 0)? {}
582   | |        ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
583...  |
584LL | |     if let true = let true = true {}
585LL | | }
586   | |_- this function should return `Result` or `Option` to accept `?`
587   |
588   = help: the trait `std::ops::Try` is not implemented for `()`
589   = note: required by `std::ops::Try::from_error`
590
591error[E0308]: mismatched types
592  --> $DIR/disallowed-positions.rs:56:8
593   |
594LL |     if x = let 0 = 0 {}
595   |        ^^^^^^^^^^^^^
596   |        |
597   |        expected `bool`, found `()`
598   |        help: try comparing for equality: `x == let 0 = 0`
599
600error[E0308]: mismatched types
601  --> $DIR/disallowed-positions.rs:59:8
602   |
603LL |     if true..(let 0 = 0) {}
604   |        ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
605   |
606   = note: expected type `bool`
607            found struct `std::ops::Range<bool>`
608
609error[E0308]: mismatched types
610  --> $DIR/disallowed-positions.rs:61:8
611   |
612LL |     if ..(let 0 = 0) {}
613   |        ^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::RangeTo`
614   |
615   = note: expected type `bool`
616            found struct `std::ops::RangeTo<bool>`
617
618error[E0308]: mismatched types
619  --> $DIR/disallowed-positions.rs:63:8
620   |
621LL |     if (let 0 = 0).. {}
622   |        ^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::RangeFrom`
623   |
624   = note: expected type `bool`
625            found struct `std::ops::RangeFrom<bool>`
626
627error[E0308]: mismatched types
628  --> $DIR/disallowed-positions.rs:67:12
629   |
630LL |     if let Range { start: _, end: _ } = true..true && false {}
631   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this expression has type `bool`
632   |            |
633   |            expected `bool`, found struct `std::ops::Range`
634   |
635   = note: expected type `bool`
636            found struct `std::ops::Range<_>`
637
638error[E0308]: mismatched types
639  --> $DIR/disallowed-positions.rs:67:8
640   |
641LL |     if let Range { start: _, end: _ } = true..true && false {}
642   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
643   |
644   = note: expected type `bool`
645            found struct `std::ops::Range<bool>`
646
647error[E0308]: mismatched types
648  --> $DIR/disallowed-positions.rs:71:12
649   |
650LL |     if let Range { start: _, end: _ } = true..true || false {}
651   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this expression has type `bool`
652   |            |
653   |            expected `bool`, found struct `std::ops::Range`
654   |
655   = note: expected type `bool`
656            found struct `std::ops::Range<_>`
657
658error[E0308]: mismatched types
659  --> $DIR/disallowed-positions.rs:71:8
660   |
661LL |     if let Range { start: _, end: _ } = true..true || false {}
662   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
663   |
664   = note: expected type `bool`
665            found struct `std::ops::Range<bool>`
666
667error[E0308]: mismatched types
668  --> $DIR/disallowed-positions.rs:78:12
669   |
670LL |     if let Range { start: F, end } = F..|| true {}
671   |            ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found struct `std::ops::Range`
672   |
673   = note: expected fn pointer `fn() -> bool`
674                  found struct `std::ops::Range<_>`
675
676error[E0308]: mismatched types
677  --> $DIR/disallowed-positions.rs:78:41
678   |
679LL |     if let Range { start: F, end } = F..|| true {}
680   |                                         ^^^^^^^ expected `bool`, found closure
681   |
682   = note: expected type `bool`
683           found closure `[closure@$DIR/disallowed-positions.rs:78:41: 78:48]`
684
685error[E0308]: mismatched types
686  --> $DIR/disallowed-positions.rs:78:8
687   |
688LL |     if let Range { start: F, end } = F..|| true {}
689   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
690   |
691   = note: expected type `bool`
692            found struct `std::ops::Range<bool>`
693
694error[E0308]: mismatched types
695  --> $DIR/disallowed-positions.rs:86:12
696   |
697LL |     if let Range { start: true, end } = t..&&false {}
698   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^   - this expression has type `&&bool`
699   |            |
700   |            expected `bool`, found struct `std::ops::Range`
701   |
702   = note: expected type `bool`
703            found struct `std::ops::Range<_>`
704
705error[E0308]: mismatched types
706  --> $DIR/disallowed-positions.rs:86:44
707   |
708LL |     if let Range { start: true, end } = t..&&false {}
709   |                                            ^^^^^^^ expected `bool`, found `&&bool`
710
711error[E0308]: mismatched types
712  --> $DIR/disallowed-positions.rs:86:8
713   |
714LL |     if let Range { start: true, end } = t..&&false {}
715   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
716   |
717   = note: expected type `bool`
718            found struct `std::ops::Range<bool>`
719
720error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
721  --> $DIR/disallowed-positions.rs:42:20
722   |
723LL |         if let 0 = 0? {}
724   |                    ^^ the `?` operator cannot be applied to type `{integer}`
725   |
726   = help: the trait `std::ops::Try` is not implemented for `{integer}`
727   = note: required by `std::ops::Try::into_result`
728
729error[E0308]: mismatched types
730  --> $DIR/disallowed-positions.rs:96:11
731   |
732LL |     while &let 0 = 0 {}
733   |           ^^^^^^^^^^
734   |           |
735   |           expected `bool`, found `&bool`
736   |           help: consider removing the borrow: `let 0 = 0`
737
738error[E0614]: type `bool` cannot be dereferenced
739  --> $DIR/disallowed-positions.rs:100:11
740   |
741LL |     while *let 0 = 0 {}
742   |           ^^^^^^^^^^
743
744error[E0600]: cannot apply unary operator `-` to type `bool`
745  --> $DIR/disallowed-positions.rs:102:11
746   |
747LL |     while -let 0 = 0 {}
748   |           ^^^^^^^^^^ cannot apply unary operator `-`
749
750error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
751  --> $DIR/disallowed-positions.rs:110:11
752   |
753LL |     while (let 0 = 0)? {}
754   |           ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
755   |
756   = help: the trait `std::ops::Try` is not implemented for `bool`
757   = note: required by `std::ops::Try::into_result`
758
759error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
760  --> $DIR/disallowed-positions.rs:110:11
761   |
762LL | / fn nested_within_while_expr() {
763LL | |     while &let 0 = 0 {}
764LL | |
765LL | |
766...  |
767LL | |     while (let 0 = 0)? {}
768   | |           ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
769...  |
770LL | |     while let true = let true = true {}
771LL | | }
772   | |_- this function should return `Result` or `Option` to accept `?`
773   |
774   = help: the trait `std::ops::Try` is not implemented for `()`
775   = note: required by `std::ops::Try::from_error`
776
777error[E0308]: mismatched types
778  --> $DIR/disallowed-positions.rs:120:11
779   |
780LL |     while x = let 0 = 0 {}
781   |           ^^^^^^^^^^^^^
782   |           |
783   |           expected `bool`, found `()`
784   |           help: try comparing for equality: `x == let 0 = 0`
785
786error[E0308]: mismatched types
787  --> $DIR/disallowed-positions.rs:123:11
788   |
789LL |     while true..(let 0 = 0) {}
790   |           ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
791   |
792   = note: expected type `bool`
793            found struct `std::ops::Range<bool>`
794
795error[E0308]: mismatched types
796  --> $DIR/disallowed-positions.rs:125:11
797   |
798LL |     while ..(let 0 = 0) {}
799   |           ^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::RangeTo`
800   |
801   = note: expected type `bool`
802            found struct `std::ops::RangeTo<bool>`
803
804error[E0308]: mismatched types
805  --> $DIR/disallowed-positions.rs:127:11
806   |
807LL |     while (let 0 = 0).. {}
808   |           ^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::RangeFrom`
809   |
810   = note: expected type `bool`
811            found struct `std::ops::RangeFrom<bool>`
812
813error[E0308]: mismatched types
814  --> $DIR/disallowed-positions.rs:131:15
815   |
816LL |     while let Range { start: _, end: _ } = true..true && false {}
817   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this expression has type `bool`
818   |               |
819   |               expected `bool`, found struct `std::ops::Range`
820   |
821   = note: expected type `bool`
822            found struct `std::ops::Range<_>`
823
824error[E0308]: mismatched types
825  --> $DIR/disallowed-positions.rs:131:11
826   |
827LL |     while let Range { start: _, end: _ } = true..true && false {}
828   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
829   |
830   = note: expected type `bool`
831            found struct `std::ops::Range<bool>`
832
833error[E0308]: mismatched types
834  --> $DIR/disallowed-positions.rs:135:15
835   |
836LL |     while let Range { start: _, end: _ } = true..true || false {}
837   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this expression has type `bool`
838   |               |
839   |               expected `bool`, found struct `std::ops::Range`
840   |
841   = note: expected type `bool`
842            found struct `std::ops::Range<_>`
843
844error[E0308]: mismatched types
845  --> $DIR/disallowed-positions.rs:135:11
846   |
847LL |     while let Range { start: _, end: _ } = true..true || false {}
848   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
849   |
850   = note: expected type `bool`
851            found struct `std::ops::Range<bool>`
852
853error[E0308]: mismatched types
854  --> $DIR/disallowed-positions.rs:142:15
855   |
856LL |     while let Range { start: F, end } = F..|| true {}
857   |               ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found struct `std::ops::Range`
858   |
859   = note: expected fn pointer `fn() -> bool`
860                  found struct `std::ops::Range<_>`
861
862error[E0308]: mismatched types
863  --> $DIR/disallowed-positions.rs:142:44
864   |
865LL |     while let Range { start: F, end } = F..|| true {}
866   |                                            ^^^^^^^ expected `bool`, found closure
867   |
868   = note: expected type `bool`
869           found closure `[closure@$DIR/disallowed-positions.rs:142:44: 142:51]`
870
871error[E0308]: mismatched types
872  --> $DIR/disallowed-positions.rs:142:11
873   |
874LL |     while let Range { start: F, end } = F..|| true {}
875   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
876   |
877   = note: expected type `bool`
878            found struct `std::ops::Range<bool>`
879
880error[E0308]: mismatched types
881  --> $DIR/disallowed-positions.rs:150:15
882   |
883LL |     while let Range { start: true, end } = t..&&false {}
884   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^   - this expression has type `&&bool`
885   |               |
886   |               expected `bool`, found struct `std::ops::Range`
887   |
888   = note: expected type `bool`
889            found struct `std::ops::Range<_>`
890
891error[E0308]: mismatched types
892  --> $DIR/disallowed-positions.rs:150:47
893   |
894LL |     while let Range { start: true, end } = t..&&false {}
895   |                                               ^^^^^^^ expected `bool`, found `&&bool`
896
897error[E0308]: mismatched types
898  --> $DIR/disallowed-positions.rs:150:11
899   |
900LL |     while let Range { start: true, end } = t..&&false {}
901   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
902   |
903   = note: expected type `bool`
904            found struct `std::ops::Range<bool>`
905
906error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
907  --> $DIR/disallowed-positions.rs:106:23
908   |
909LL |         while let 0 = 0? {}
910   |                       ^^ the `?` operator cannot be applied to type `{integer}`
911   |
912   = help: the trait `std::ops::Try` is not implemented for `{integer}`
913   = note: required by `std::ops::Try::into_result`
914
915error[E0614]: type `bool` cannot be dereferenced
916  --> $DIR/disallowed-positions.rs:173:5
917   |
918LL |     *let 0 = 0;
919   |     ^^^^^^^^^^
920
921error[E0600]: cannot apply unary operator `-` to type `bool`
922  --> $DIR/disallowed-positions.rs:175:5
923   |
924LL |     -let 0 = 0;
925   |     ^^^^^^^^^^ cannot apply unary operator `-`
926
927error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
928  --> $DIR/disallowed-positions.rs:183:5
929   |
930LL |     (let 0 = 0)?;
931   |     ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
932   |
933   = help: the trait `std::ops::Try` is not implemented for `bool`
934   = note: required by `std::ops::Try::into_result`
935
936error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
937  --> $DIR/disallowed-positions.rs:183:5
938   |
939LL | / fn outside_if_and_while_expr() {
940LL | |     &let 0 = 0;
941LL | |
942LL | |     !let 0 = 0;
943...  |
944LL | |     (let 0 = 0)?;
945   | |     ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
946...  |
947LL | |
948LL | | }
949   | |_- this function should return `Result` or `Option` to accept `?`
950   |
951   = help: the trait `std::ops::Try` is not implemented for `()`
952   = note: required by `std::ops::Try::from_error`
953
954error[E0308]: mismatched types
955  --> $DIR/disallowed-positions.rs:198:10
956   |
957LL |     (let Range { start: _, end: _ } = true..true || false);
958   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this expression has type `bool`
959   |          |
960   |          expected `bool`, found struct `std::ops::Range`
961   |
962   = note: expected type `bool`
963            found struct `std::ops::Range<_>`
964
965error[E0308]: mismatched types
966  --> $DIR/disallowed-positions.rs:207:5
967   |
968LL | fn outside_if_and_while_expr() {
969   |                                - help: try adding a return type: `-> &bool`
970...
971LL |     &let 0 = 0
972   |     ^^^^^^^^^^ expected `()`, found `&bool`
973
974error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
975  --> $DIR/disallowed-positions.rs:179:17
976   |
977LL |         let 0 = 0?;
978   |                 ^^ the `?` operator cannot be applied to type `{integer}`
979   |
980   = help: the trait `std::ops::Try` is not implemented for `{integer}`
981   = note: required by `std::ops::Try::into_result`
982
983error: aborting due to 106 previous errors
984
985Some errors have detailed explanations: E0277, E0308, E0600, E0614, E0658.
986For more information about an error, try `rustc --explain E0277`.