]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-fn-error.rs
Bless nll tests.
[rust.git] / src / test / ui / consts / const-fn-error.rs
1 const X : usize = 2;
2
3 const fn f(x: usize) -> usize {
4     let mut sum = 0;
5     for i in 0..x {
6         //~^ ERROR mutable references
7         //~| ERROR calls in constant functions
8         //~| ERROR calls in constant functions
9         //~| ERROR E0080
10         //~| ERROR `for` is not allowed in a `const fn`
11         sum += i;
12     }
13     sum
14 }
15
16 #[allow(unused_variables)]
17 fn main() {
18     let a : [i32; f(X)];
19 }