]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-fn-error.stderr
Bless nll tests.
[rust.git] / src / test / ui / consts / const-fn-error.stderr
1 error[E0658]: `for` is not allowed in a `const fn`
2   --> $DIR/const-fn-error.rs:5:5
3    |
4 LL | /     for i in 0..x {
5 LL | |
6 LL | |
7 LL | |
8 ...  |
9 LL | |         sum += i;
10 LL | |     }
11    | |_____^
12    |
13    = note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
14    = help: add `#![feature(const_for)]` to the crate attributes to enable
15
16 error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
17   --> $DIR/const-fn-error.rs:5:14
18    |
19 LL |     for i in 0..x {
20    |              ^^^^
21
22 error[E0658]: mutable references are not allowed in constant functions
23   --> $DIR/const-fn-error.rs:5:14
24    |
25 LL |     for i in 0..x {
26    |              ^^^^
27    |
28    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
29    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
30
31 error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
32   --> $DIR/const-fn-error.rs:5:14
33    |
34 LL |     for i in 0..x {
35    |              ^^^^
36
37 error[E0080]: evaluation of constant value failed
38   --> $DIR/const-fn-error.rs:5:14
39    |
40 LL |     for i in 0..x {
41    |              ^^^^
42    |              |
43    |              calling non-const function `<std::ops::Range<usize> as IntoIterator>::into_iter`
44    |              inside `f` at $DIR/const-fn-error.rs:5:14
45 ...
46 LL |     let a : [i32; f(X)];
47    |                   ---- inside `main::{constant#0}` at $DIR/const-fn-error.rs:18:19
48
49 error: aborting due to 5 previous errors
50
51 Some errors have detailed explanations: E0015, E0080, E0658.
52 For more information about an error, try `rustc --explain E0015`.