Skip to content

Commit 9600489

Browse files
committed
Fix tests
1 parent 29c43fe commit 9600489

File tree

6 files changed

+7
-2
lines changed

6 files changed

+7
-2
lines changed

src/test/compile-fail/const-err-early.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ pub const C: u8 = 200u8 * 4; //~ ERROR const_err
1919
//~^ ERROR this constant cannot be used
2020
pub const D: u8 = 42u8 - (42u8 + 1); //~ ERROR const_err
2121
//~^ ERROR this constant cannot be used
22-
pub const E: u8 = [5u8][1];
23-
//~^ ERROR const_err
22+
pub const E: u8 = [5u8][1]; //~ ERROR const_err
23+
//~| ERROR this constant cannot be used
2424

2525
fn main() {
2626
let _a = A;

src/test/compile-fail/const-err2.rs

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ fn main() {
3131
let d = 42u8 - (42u8 + 1);
3232
//~^ ERROR const_err
3333
let _e = [5u8][1];
34+
//~^ ERROR const_err
3435
black_box(a);
3536
black_box(b);
3637
black_box(c);

src/test/compile-fail/const-err3.rs

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ fn main() {
2323
let d = 42u8 - (42u8 + 1);
2424
//~^ ERROR const_err
2525
let _e = [5u8][1];
26+
//~^ ERROR const_err
2627
black_box(b);
2728
black_box(c);
2829
black_box(d);

src/test/run-fail/mir_indexing_oob_1.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
const C: [u32; 5] = [0; 5];
1414

15+
#[allow(const_err)]
1516
fn test() -> u32 {
1617
C[10]
1718
}

src/test/run-fail/mir_indexing_oob_2.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
const C: &'static [u8; 5] = b"hello";
1414

15+
#[allow(const_err)]
1516
fn test() -> u8 {
1617
C[10]
1718
}

src/test/run-fail/mir_indexing_oob_3.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
const C: &'static [u8; 5] = b"hello";
1414

15+
#[allow(const_err)]
1516
fn mir() -> u8 {
1617
C[10]
1718
}

0 commit comments

Comments
 (0)