fork/rust

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

borsAuto merge of #68568 - pietroalbini:stable-next, r=pietroalbini5e1a799842b

1.41.0
35.0 KiB992 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: for more information, see https://github.com/rust-lang/rust/issues/49146
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: for more information, see https://github.com/rust-lang/rust/issues/49146
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: for more information, see https://github.com/rust-lang/rust/issues/49146
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   |
564   = note: an implementation of `std::ops::Neg` might be missing for `bool`
565
566error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
567  --> $DIR/disallowed-positions.rs:46:8
568   |
569LL |     if (let 0 = 0)? {}
570   |        ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
571   |
572   = help: the trait `std::ops::Try` is not implemented for `bool`
573   = note: required by `std::ops::Try::into_result`
574
575error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
576  --> $DIR/disallowed-positions.rs:46:8
577   |
578LL | / fn nested_within_if_expr() {
579LL | |     if &let 0 = 0 {}
580LL | |
581LL | |
582...  |
583LL | |     if (let 0 = 0)? {}
584   | |        ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
585...  |
586LL | |     if let true = let true = true {}
587LL | | }
588   | |_- this function should return `Result` or `Option` to accept `?`
589   |
590   = help: the trait `std::ops::Try` is not implemented for `()`
591   = note: required by `std::ops::Try::from_error`
592
593error[E0308]: mismatched types
594  --> $DIR/disallowed-positions.rs:56:8
595   |
596LL |     if x = let 0 = 0 {}
597   |        ^^^^^^^^^^^^^
598   |        |
599   |        expected `bool`, found `()`
600   |        help: try comparing for equality: `x == let 0 = 0`
601
602error[E0308]: mismatched types
603  --> $DIR/disallowed-positions.rs:59:8
604   |
605LL |     if true..(let 0 = 0) {}
606   |        ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
607   |
608   = note: expected type `bool`
609            found struct `std::ops::Range<bool>`
610
611error[E0308]: mismatched types
612  --> $DIR/disallowed-positions.rs:61:8
613   |
614LL |     if ..(let 0 = 0) {}
615   |        ^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::RangeTo`
616   |
617   = note: expected type `bool`
618            found struct `std::ops::RangeTo<bool>`
619
620error[E0308]: mismatched types
621  --> $DIR/disallowed-positions.rs:63:8
622   |
623LL |     if (let 0 = 0).. {}
624   |        ^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::RangeFrom`
625   |
626   = note: expected type `bool`
627            found struct `std::ops::RangeFrom<bool>`
628
629error[E0308]: mismatched types
630  --> $DIR/disallowed-positions.rs:67:12
631   |
632LL |     if let Range { start: _, end: _ } = true..true && false {}
633   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this match expression has type `bool`
634   |            |
635   |            expected `bool`, found struct `std::ops::Range`
636   |
637   = note: expected type `bool`
638            found struct `std::ops::Range<_>`
639
640error[E0308]: mismatched types
641  --> $DIR/disallowed-positions.rs:67:8
642   |
643LL |     if let Range { start: _, end: _ } = true..true && false {}
644   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
645   |
646   = note: expected type `bool`
647            found struct `std::ops::Range<bool>`
648
649error[E0308]: mismatched types
650  --> $DIR/disallowed-positions.rs:71:12
651   |
652LL |     if let Range { start: _, end: _ } = true..true || false {}
653   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this match expression has type `bool`
654   |            |
655   |            expected `bool`, found struct `std::ops::Range`
656   |
657   = note: expected type `bool`
658            found struct `std::ops::Range<_>`
659
660error[E0308]: mismatched types
661  --> $DIR/disallowed-positions.rs:71:8
662   |
663LL |     if let Range { start: _, end: _ } = true..true || false {}
664   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
665   |
666   = note: expected type `bool`
667            found struct `std::ops::Range<bool>`
668
669error[E0308]: mismatched types
670  --> $DIR/disallowed-positions.rs:78:12
671   |
672LL |     if let Range { start: F, end } = F..|| true {}
673   |            ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found struct `std::ops::Range`
674   |
675   = note: expected fn pointer `fn() -> bool`
676                  found struct `std::ops::Range<_>`
677
678error[E0308]: mismatched types
679  --> $DIR/disallowed-positions.rs:78:41
680   |
681LL |     if let Range { start: F, end } = F..|| true {}
682   |                                         ^^^^^^^ expected `bool`, found closure
683   |
684   = note: expected type `bool`
685           found closure `[closure@$DIR/disallowed-positions.rs:78:41: 78:48]`
686
687error[E0308]: mismatched types
688  --> $DIR/disallowed-positions.rs:78:8
689   |
690LL |     if let Range { start: F, end } = F..|| true {}
691   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
692   |
693   = note: expected type `bool`
694            found struct `std::ops::Range<bool>`
695
696error[E0308]: mismatched types
697  --> $DIR/disallowed-positions.rs:86:12
698   |
699LL |     if let Range { start: true, end } = t..&&false {}
700   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^   - this match expression has type `bool`
701   |            |
702   |            expected `bool`, found struct `std::ops::Range`
703   |
704   = note: expected type `bool`
705            found struct `std::ops::Range<_>`
706
707error[E0308]: mismatched types
708  --> $DIR/disallowed-positions.rs:86:44
709   |
710LL |     if let Range { start: true, end } = t..&&false {}
711   |                                            ^^^^^^^ expected `bool`, found `&&bool`
712
713error[E0308]: mismatched types
714  --> $DIR/disallowed-positions.rs:86:8
715   |
716LL |     if let Range { start: true, end } = t..&&false {}
717   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
718   |
719   = note: expected type `bool`
720            found struct `std::ops::Range<bool>`
721
722error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
723  --> $DIR/disallowed-positions.rs:42:20
724   |
725LL |         if let 0 = 0? {}
726   |                    ^^ the `?` operator cannot be applied to type `{integer}`
727   |
728   = help: the trait `std::ops::Try` is not implemented for `{integer}`
729   = note: required by `std::ops::Try::into_result`
730
731error[E0308]: mismatched types
732  --> $DIR/disallowed-positions.rs:96:11
733   |
734LL |     while &let 0 = 0 {}
735   |           ^^^^^^^^^^
736   |           |
737   |           expected `bool`, found `&bool`
738   |           help: consider removing the borrow: `let 0 = 0`
739
740error[E0614]: type `bool` cannot be dereferenced
741  --> $DIR/disallowed-positions.rs:100:11
742   |
743LL |     while *let 0 = 0 {}
744   |           ^^^^^^^^^^
745
746error[E0600]: cannot apply unary operator `-` to type `bool`
747  --> $DIR/disallowed-positions.rs:102:11
748   |
749LL |     while -let 0 = 0 {}
750   |           ^^^^^^^^^^ cannot apply unary operator `-`
751   |
752   = note: an implementation of `std::ops::Neg` might be missing for `bool`
753
754error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
755  --> $DIR/disallowed-positions.rs:110:11
756   |
757LL |     while (let 0 = 0)? {}
758   |           ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
759   |
760   = help: the trait `std::ops::Try` is not implemented for `bool`
761   = note: required by `std::ops::Try::into_result`
762
763error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
764  --> $DIR/disallowed-positions.rs:110:11
765   |
766LL | / fn nested_within_while_expr() {
767LL | |     while &let 0 = 0 {}
768LL | |
769LL | |
770...  |
771LL | |     while (let 0 = 0)? {}
772   | |           ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
773...  |
774LL | |     while let true = let true = true {}
775LL | | }
776   | |_- this function should return `Result` or `Option` to accept `?`
777   |
778   = help: the trait `std::ops::Try` is not implemented for `()`
779   = note: required by `std::ops::Try::from_error`
780
781error[E0308]: mismatched types
782  --> $DIR/disallowed-positions.rs:120:11
783   |
784LL |     while x = let 0 = 0 {}
785   |           ^^^^^^^^^^^^^
786   |           |
787   |           expected `bool`, found `()`
788   |           help: try comparing for equality: `x == let 0 = 0`
789
790error[E0308]: mismatched types
791  --> $DIR/disallowed-positions.rs:123:11
792   |
793LL |     while true..(let 0 = 0) {}
794   |           ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
795   |
796   = note: expected type `bool`
797            found struct `std::ops::Range<bool>`
798
799error[E0308]: mismatched types
800  --> $DIR/disallowed-positions.rs:125:11
801   |
802LL |     while ..(let 0 = 0) {}
803   |           ^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::RangeTo`
804   |
805   = note: expected type `bool`
806            found struct `std::ops::RangeTo<bool>`
807
808error[E0308]: mismatched types
809  --> $DIR/disallowed-positions.rs:127:11
810   |
811LL |     while (let 0 = 0).. {}
812   |           ^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::RangeFrom`
813   |
814   = note: expected type `bool`
815            found struct `std::ops::RangeFrom<bool>`
816
817error[E0308]: mismatched types
818  --> $DIR/disallowed-positions.rs:131:15
819   |
820LL |     while let Range { start: _, end: _ } = true..true && false {}
821   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this match expression has type `bool`
822   |               |
823   |               expected `bool`, found struct `std::ops::Range`
824   |
825   = note: expected type `bool`
826            found struct `std::ops::Range<_>`
827
828error[E0308]: mismatched types
829  --> $DIR/disallowed-positions.rs:131:11
830   |
831LL |     while let Range { start: _, end: _ } = true..true && false {}
832   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
833   |
834   = note: expected type `bool`
835            found struct `std::ops::Range<bool>`
836
837error[E0308]: mismatched types
838  --> $DIR/disallowed-positions.rs:135:15
839   |
840LL |     while let Range { start: _, end: _ } = true..true || false {}
841   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this match expression has type `bool`
842   |               |
843   |               expected `bool`, found struct `std::ops::Range`
844   |
845   = note: expected type `bool`
846            found struct `std::ops::Range<_>`
847
848error[E0308]: mismatched types
849  --> $DIR/disallowed-positions.rs:135:11
850   |
851LL |     while let Range { start: _, end: _ } = true..true || false {}
852   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
853   |
854   = note: expected type `bool`
855            found struct `std::ops::Range<bool>`
856
857error[E0308]: mismatched types
858  --> $DIR/disallowed-positions.rs:142:15
859   |
860LL |     while let Range { start: F, end } = F..|| true {}
861   |               ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found struct `std::ops::Range`
862   |
863   = note: expected fn pointer `fn() -> bool`
864                  found struct `std::ops::Range<_>`
865
866error[E0308]: mismatched types
867  --> $DIR/disallowed-positions.rs:142:44
868   |
869LL |     while let Range { start: F, end } = F..|| true {}
870   |                                            ^^^^^^^ expected `bool`, found closure
871   |
872   = note: expected type `bool`
873           found closure `[closure@$DIR/disallowed-positions.rs:142:44: 142:51]`
874
875error[E0308]: mismatched types
876  --> $DIR/disallowed-positions.rs:142:11
877   |
878LL |     while let Range { start: F, end } = F..|| true {}
879   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
880   |
881   = note: expected type `bool`
882            found struct `std::ops::Range<bool>`
883
884error[E0308]: mismatched types
885  --> $DIR/disallowed-positions.rs:150:15
886   |
887LL |     while let Range { start: true, end } = t..&&false {}
888   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^   - this match expression has type `bool`
889   |               |
890   |               expected `bool`, found struct `std::ops::Range`
891   |
892   = note: expected type `bool`
893            found struct `std::ops::Range<_>`
894
895error[E0308]: mismatched types
896  --> $DIR/disallowed-positions.rs:150:47
897   |
898LL |     while let Range { start: true, end } = t..&&false {}
899   |                                               ^^^^^^^ expected `bool`, found `&&bool`
900
901error[E0308]: mismatched types
902  --> $DIR/disallowed-positions.rs:150:11
903   |
904LL |     while let Range { start: true, end } = t..&&false {}
905   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
906   |
907   = note: expected type `bool`
908            found struct `std::ops::Range<bool>`
909
910error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
911  --> $DIR/disallowed-positions.rs:106:23
912   |
913LL |         while let 0 = 0? {}
914   |                       ^^ the `?` operator cannot be applied to type `{integer}`
915   |
916   = help: the trait `std::ops::Try` is not implemented for `{integer}`
917   = note: required by `std::ops::Try::into_result`
918
919error[E0614]: type `bool` cannot be dereferenced
920  --> $DIR/disallowed-positions.rs:173:5
921   |
922LL |     *let 0 = 0;
923   |     ^^^^^^^^^^
924
925error[E0600]: cannot apply unary operator `-` to type `bool`
926  --> $DIR/disallowed-positions.rs:175:5
927   |
928LL |     -let 0 = 0;
929   |     ^^^^^^^^^^ cannot apply unary operator `-`
930   |
931   = note: an implementation of `std::ops::Neg` might be missing for `bool`
932
933error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
934  --> $DIR/disallowed-positions.rs:183:5
935   |
936LL |     (let 0 = 0)?;
937   |     ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
938   |
939   = help: the trait `std::ops::Try` is not implemented for `bool`
940   = note: required by `std::ops::Try::into_result`
941
942error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
943  --> $DIR/disallowed-positions.rs:183:5
944   |
945LL | / fn outside_if_and_while_expr() {
946LL | |     &let 0 = 0;
947LL | |
948LL | |     !let 0 = 0;
949...  |
950LL | |     (let 0 = 0)?;
951   | |     ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
952...  |
953LL | |
954LL | | }
955   | |_- this function should return `Result` or `Option` to accept `?`
956   |
957   = help: the trait `std::ops::Try` is not implemented for `()`
958   = note: required by `std::ops::Try::from_error`
959
960error[E0308]: mismatched types
961  --> $DIR/disallowed-positions.rs:198:10
962   |
963LL |     (let Range { start: _, end: _ } = true..true || false);
964   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this match expression has type `bool`
965   |          |
966   |          expected `bool`, found struct `std::ops::Range`
967   |
968   = note: expected type `bool`
969            found struct `std::ops::Range<_>`
970
971error[E0308]: mismatched types
972  --> $DIR/disallowed-positions.rs:207:5
973   |
974LL | fn outside_if_and_while_expr() {
975   |                                - help: try adding a return type: `-> &bool`
976...
977LL |     &let 0 = 0
978   |     ^^^^^^^^^^ expected `()`, found `&bool`
979
980error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
981  --> $DIR/disallowed-positions.rs:179:17
982   |
983LL |         let 0 = 0?;
984   |                 ^^ the `?` operator cannot be applied to type `{integer}`
985   |
986   = help: the trait `std::ops::Try` is not implemented for `{integer}`
987   = note: required by `std::ops::Try::into_result`
988
989error: aborting due to 106 previous errors
990
991Some errors have detailed explanations: E0277, E0308, E0600, E0614, E0658.
992For more information about an error, try `rustc --explain E0277`.