mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 12:36:35 +03:00
17 lines
354 B
Rust
17 lines
354 B
Rust
const X : usize = 2;
|
|
|
|
const fn f(x: usize) -> usize {
|
|
let mut sum = 0;
|
|
for i in 0..x {
|
|
//~^ ERROR `std::ops::Range<usize>: [const] Iterator` is not satisfied
|
|
//~| ERROR `std::ops::Range<usize>: [const] Iterator` is not satisfied
|
|
sum += i;
|
|
}
|
|
sum
|
|
}
|
|
|
|
#[allow(unused_variables)]
|
|
fn main() {
|
|
let a : [i32; f(X)];
|
|
}
|