Skip to content

Commit 50454cf

Browse files
committed
Move array-slice-vec-related tests
1 parent 6871d43 commit 50454cf

29 files changed

+17
-17
lines changed
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
// run-pass
2-
#![allow(dead_code)]
3-
#![allow(stable_features)]
4-
5-
#![feature(const_indexing)]
1+
const A: [i32; 0] = [];
2+
const B: i32 = A[1];
3+
//~^ index out of bounds: the length is 0 but the index is 1
4+
//~| ERROR any use of this value will cause an error
65

76
fn main() {
8-
const ARR: [i32; 6] = [42, 43, 44, 45, 46, 47];
9-
const IDX: usize = 3;
10-
const VAL: i32 = ARR[IDX];
11-
const BLUB: [i32; (ARR[0] - 41) as usize] = [5];
7+
let _ = B;
128
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// run-pass
2+
#![allow(dead_code)]
3+
#![allow(stable_features)]
4+
5+
#![feature(const_indexing)]
6+
7+
fn main() {
8+
const ARR: [i32; 6] = [42, 43, 44, 45, 46, 47];
9+
const IDX: usize = 3;
10+
const VAL: i32 = ARR[IDX];
11+
const BLUB: [i32; (ARR[0] - 41) as usize] = [5];
12+
}
File renamed without changes.
File renamed without changes.

src/test/ui/array_const_index-1.rs

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)