|
| 1 | +warning: constant evaluation error: non-constant path in constant expression |
| 2 | + --> $DIR/const-fn-error.rs:27:19 |
| 3 | + | |
| 4 | +27 | let a : [i32; f(X)]; |
| 5 | + | ^^^^ |
| 6 | + | |
| 7 | + = note: #[warn(const_err)] on by default |
| 8 | + |
| 9 | +error[E0016]: blocks in constant functions are limited to items and tail expressions |
| 10 | + --> $DIR/const-fn-error.rs:16:19 |
| 11 | + | |
| 12 | +16 | let mut sum = 0; //~ ERROR blocks in constant functions are limited |
| 13 | + | ^ |
| 14 | + |
| 15 | +error[E0015]: calls in constant functions are limited to constant functions, struct and enum constructors |
| 16 | + --> $DIR/const-fn-error.rs:17:5 |
| 17 | + | |
| 18 | +17 | / for i in 0..x { //~ ERROR calls in constant functions |
| 19 | +18 | | //~| ERROR constant function contains unimplemented |
| 20 | +19 | | sum += i; |
| 21 | +20 | | } |
| 22 | + | |_____^ |
| 23 | + |
| 24 | +error[E0019]: constant function contains unimplemented expression type |
| 25 | + --> $DIR/const-fn-error.rs:17:5 |
| 26 | + | |
| 27 | +17 | / for i in 0..x { //~ ERROR calls in constant functions |
| 28 | +18 | | //~| ERROR constant function contains unimplemented |
| 29 | +19 | | sum += i; |
| 30 | +20 | | } |
| 31 | + | |_____^ |
| 32 | + |
1 | 33 | error[E0080]: constant evaluation error
|
2 |
| - --> $DIR/const-fn-error.rs:20:5 |
| 34 | + --> $DIR/const-fn-error.rs:21:5 |
3 | 35 | |
|
4 |
| -20 | sum //~ ERROR E0080 |
| 36 | +21 | sum //~ ERROR E0080 |
5 | 37 | | ^^^ non-constant path in constant expression
|
6 | 38 | |
|
7 | 39 | note: for constant expression here
|
8 |
| - --> $DIR/const-fn-error.rs:26:13 |
| 40 | + --> $DIR/const-fn-error.rs:27:13 |
9 | 41 | |
|
10 |
| -26 | let a : [i32; f(X)]; |
| 42 | +27 | let a : [i32; f(X)]; |
11 | 43 | | ^^^^^^^^^^^
|
12 | 44 |
|
13 |
| -error: aborting due to previous error |
| 45 | +error: aborting due to 4 previous errors |
14 | 46 |
|
0 commit comments