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