1
Fork 0

Fix tests

This commit is contained in:
Fabian Zaiser 2018-06-03 23:39:02 +02:00
parent 29c43fea37
commit 96004899be
6 changed files with 7 additions and 2 deletions

View file

@ -19,8 +19,8 @@ pub const C: u8 = 200u8 * 4; //~ ERROR const_err
//~^ ERROR this constant cannot be used
pub const D: u8 = 42u8 - (42u8 + 1); //~ ERROR const_err
//~^ ERROR this constant cannot be used
pub const E: u8 = [5u8][1];
//~^ ERROR const_err
pub const E: u8 = [5u8][1]; //~ ERROR const_err
//~| ERROR this constant cannot be used
fn main() {
let _a = A;

View file

@ -31,6 +31,7 @@ fn main() {
let d = 42u8 - (42u8 + 1);
//~^ ERROR const_err
let _e = [5u8][1];
//~^ ERROR const_err
black_box(a);
black_box(b);
black_box(c);

View file

@ -23,6 +23,7 @@ fn main() {
let d = 42u8 - (42u8 + 1);
//~^ ERROR const_err
let _e = [5u8][1];
//~^ ERROR const_err
black_box(b);
black_box(c);
black_box(d);

View file

@ -12,6 +12,7 @@
const C: [u32; 5] = [0; 5];
#[allow(const_err)]
fn test() -> u32 {
C[10]
}

View file

@ -12,6 +12,7 @@
const C: &'static [u8; 5] = b"hello";
#[allow(const_err)]
fn test() -> u8 {
C[10]
}

View file

@ -12,6 +12,7 @@
const C: &'static [u8; 5] = b"hello";
#[allow(const_err)]
fn mir() -> u8 {
C[10]
}