blob: 077c4d60e649c3cd4240111035520355abbe49ad [file] [log] [blame]
error[E0016]: blocks in constant functions are limited to items and tail expressions
--> $DIR/const-fn-error.rs:16:19
|
LL | let mut sum = 0;
| ^
error[E0015]: calls in constant functions are limited to constant functions, struct and enum constructors
--> $DIR/const-fn-error.rs:18:14
|
LL | for i in 0..x {
| ^^^^
error[E0019]: constant function contains unimplemented expression type
--> $DIR/const-fn-error.rs:18:14
|
LL | for i in 0..x {
| ^^^^
error[E0080]: constant evaluation error
--> $DIR/const-fn-error.rs:18:14
|
LL | for i in 0..x {
| ^^^^ calling non-const fn `<I as std::iter::IntoIterator><std::ops::Range<usize>>::into_iter`
...
LL | let a : [i32; f(X)];
| ---- inside call to `f`
|
note: for constant expression here
--> $DIR/const-fn-error.rs:29:13
|
LL | let a : [i32; f(X)];
| ^^^^^^^^^^^
error: aborting due to 4 previous errors
Some errors occurred: E0015, E0016, E0019, E0080.
For more information about an error, try `rustc --explain E0015`.