rust/tests/ui/feature-gates/feature-gate-const-indexing.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

9 lines
228 B
Rust
Raw Normal View History

// build-pass (FIXME(62277): could be check-pass?)
fn main() {
const ARR: [i32; 6] = [42, 43, 44, 45, 46, 47];
const IDX: usize = 3;
const VAL: i32 = ARR[IDX];
2018-01-16 02:24:38 -06:00
const BLUB: [i32; (ARR[0] - 41) as usize] = [5];
}