diff options
| author | Fabian Zaiser <fabian.zaiser@gmail.com> | 2018-06-03 23:39:02 +0200 |
|---|---|---|
| committer | Fabian Zaiser <fabian.zaiser@gmail.com> | 2018-06-05 10:35:44 +0200 |
| commit | 96004899bec1d63a8f54bea461f2d2a2965d4636 (patch) | |
| tree | 605e3596070ecba7bc8d0c170d6bb6ebb5904c8f | |
| parent | 29c43fea376624d62a8466e9304312f70c19d558 (diff) | |
| download | rust-96004899bec1d63a8f54bea461f2d2a2965d4636.tar.gz rust-96004899bec1d63a8f54bea461f2d2a2965d4636.zip | |
Fix tests
| -rw-r--r-- | src/test/compile-fail/const-err-early.rs | 4 | ||||
| -rw-r--r-- | src/test/compile-fail/const-err2.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/const-err3.rs | 1 | ||||
| -rw-r--r-- | src/test/run-fail/mir_indexing_oob_1.rs | 1 | ||||
| -rw-r--r-- | src/test/run-fail/mir_indexing_oob_2.rs | 1 | ||||
| -rw-r--r-- | src/test/run-fail/mir_indexing_oob_3.rs | 1 |
6 files changed, 7 insertions, 2 deletions
diff --git a/src/test/compile-fail/const-err-early.rs b/src/test/compile-fail/const-err-early.rs index 6caec159d01..f8b20f6ee79 100644 --- a/src/test/compile-fail/const-err-early.rs +++ b/src/test/compile-fail/const-err-early.rs @@ -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; diff --git a/src/test/compile-fail/const-err2.rs b/src/test/compile-fail/const-err2.rs index 46b73371e56..9a5cb5a4a83 100644 --- a/src/test/compile-fail/const-err2.rs +++ b/src/test/compile-fail/const-err2.rs @@ -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); diff --git a/src/test/compile-fail/const-err3.rs b/src/test/compile-fail/const-err3.rs index 9656af60024..f5e43b57e77 100644 --- a/src/test/compile-fail/const-err3.rs +++ b/src/test/compile-fail/const-err3.rs @@ -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); diff --git a/src/test/run-fail/mir_indexing_oob_1.rs b/src/test/run-fail/mir_indexing_oob_1.rs index 41ff466f810..cf342ad94f9 100644 --- a/src/test/run-fail/mir_indexing_oob_1.rs +++ b/src/test/run-fail/mir_indexing_oob_1.rs @@ -12,6 +12,7 @@ const C: [u32; 5] = [0; 5]; +#[allow(const_err)] fn test() -> u32 { C[10] } diff --git a/src/test/run-fail/mir_indexing_oob_2.rs b/src/test/run-fail/mir_indexing_oob_2.rs index c5c823428bc..3eb94682b20 100644 --- a/src/test/run-fail/mir_indexing_oob_2.rs +++ b/src/test/run-fail/mir_indexing_oob_2.rs @@ -12,6 +12,7 @@ const C: &'static [u8; 5] = b"hello"; +#[allow(const_err)] fn test() -> u8 { C[10] } diff --git a/src/test/run-fail/mir_indexing_oob_3.rs b/src/test/run-fail/mir_indexing_oob_3.rs index 9bc4b0025e5..06bb6d4d287 100644 --- a/src/test/run-fail/mir_indexing_oob_3.rs +++ b/src/test/run-fail/mir_indexing_oob_3.rs @@ -12,6 +12,7 @@ const C: &'static [u8; 5] = b"hello"; +#[allow(const_err)] fn mir() -> u8 { C[10] } |
