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