Move array-slice-vec-related tests

This commit is contained in:
Yuki Okushi 2020-12-31 08:01:58 +09:00
parent 6871d43d4c
commit 50454cf64b
29 changed files with 17 additions and 17 deletions

View file

@ -1,12 +1,8 @@
// run-pass
#![allow(dead_code)]
#![allow(stable_features)]
#![feature(const_indexing)]
const A: [i32; 0] = [];
const B: i32 = A[1];
//~^ index out of bounds: the length is 0 but the index is 1
//~| ERROR any use of this value will cause an error
fn main() {
const ARR: [i32; 6] = [42, 43, 44, 45, 46, 47];
const IDX: usize = 3;
const VAL: i32 = ARR[IDX];
const BLUB: [i32; (ARR[0] - 41) as usize] = [5];
let _ = B;
}

View file

@ -0,0 +1,12 @@
// run-pass
#![allow(dead_code)]
#![allow(stable_features)]
#![feature(const_indexing)]
fn main() {
const ARR: [i32; 6] = [42, 43, 44, 45, 46, 47];
const IDX: usize = 3;
const VAL: i32 = ARR[IDX];
const BLUB: [i32; (ARR[0] - 41) as usize] = [5];
}

View file

@ -1,8 +0,0 @@
const A: [i32; 0] = [];
const B: i32 = A[1];
//~^ index out of bounds: the length is 0 but the index is 1
//~| ERROR any use of this value will cause an error
fn main() {
let _ = B;
}