]> git.proxmox.com Git - rustc.git/blame - src/test/ui/never_type/issue-52443.stderr
New upstream version 1.60.0+dfsg1
[rustc.git] / src / test / ui / never_type / issue-52443.stderr
CommitLineData
5869c6ff
XL
1warning: denote infinite loops with `loop { ... }`
2 --> $DIR/issue-52443.rs:6:11
3 |
4LL | [(); {while true {break}; 0}];
5 | ^^^^^^^^^^ help: use `loop`
6 |
7 = note: `#[warn(while_true)]` on by default
8
94222f64 9error[E0658]: `for` is not allowed in a `const`
5869c6ff
XL
10 --> $DIR/issue-52443.rs:9:12
11 |
12LL | [(); { for _ in 0usize.. {}; 0}];
13 | ^^^^^^^^^^^^^^^^^^^^
94222f64
XL
14 |
15 = note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
16 = help: add `#![feature(const_for)]` to the crate attributes to enable
5869c6ff
XL
17
18error[E0308]: mismatched types
19 --> $DIR/issue-52443.rs:2:10
20 |
21LL | [(); & { loop { continue } } ];
94222f64 22 | ^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found reference
5869c6ff
XL
23 |
24 = note: expected type `usize`
25 found reference `&_`
94222f64
XL
26help: consider removing the borrow
27 |
28LL - [(); & { loop { continue } } ];
29LL + [(); { loop { continue } } ];
30 |
5869c6ff
XL
31
32error[E0308]: mismatched types
33 --> $DIR/issue-52443.rs:4:17
34 |
35LL | [(); loop { break }];
36 | ^^^^^
37 | |
38 | expected `usize`, found `()`
39 | help: give it a value of the expected type: `break 42`
40
5099ac24 41error[E0015]: cannot convert `RangeFrom<usize>` into an iterator in constants
5869c6ff
XL
42 --> $DIR/issue-52443.rs:9:21
43 |
44LL | [(); { for _ in 0usize.. {}; 0}];
45 | ^^^^^^^^
5099ac24
FG
46 |
47note: impl defined here, but it is not `const`
48 --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
49 |
50LL | impl<I: Iterator> IntoIterator for I {
51 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
52 = note: calls in constants are limited to constant functions, tuple structs and tuple variants
5869c6ff
XL
53
54error[E0658]: mutable references are not allowed in constants
55 --> $DIR/issue-52443.rs:9:21
56 |
57LL | [(); { for _ in 0usize.. {}; 0}];
58 | ^^^^^^^^
59 |
60 = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
61 = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
62
5099ac24 63error[E0015]: cannot call non-const fn `<RangeFrom<usize> as Iterator>::next` in constants
5869c6ff
XL
64 --> $DIR/issue-52443.rs:9:21
65 |
66LL | [(); { for _ in 0usize.. {}; 0}];
67 | ^^^^^^^^
5099ac24
FG
68 |
69 = note: calls in constants are limited to constant functions, tuple structs and tuple variants
5869c6ff
XL
70
71error: aborting due to 6 previous errors; 1 warning emitted
72
94222f64 73Some errors have detailed explanations: E0015, E0308, E0658.
5869c6ff 74For more information about an error, try `rustc --explain E0015`.