]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-fn-error.rs
Do not suggest `let_else` if no bindings would be introduced
[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 cannot convert
8         //~| ERROR cannot call non-const fn
9         //~| ERROR `for` is not allowed in a `const fn`
10         sum += i;
11     }
12     sum
13 }
14
15 #[allow(unused_variables)]
16 fn main() {
17     let a : [i32; f(X)];
18 }