Skip to content

Commit bcdb260

Browse files
Aatcheddyb
authored andcommitted
Enable the overflow-related tests for MIR
1 parent f2c983b commit bcdb260

20 files changed

+0
-39
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
// these errors are not actually "const_err", they occur in trans/consts
1212
// and are unconditional warnings that can't be denied or allowed
1313

14-
#![feature(rustc_attrs)]
1514
#![allow(exceeding_bitshifts)]
1615
#![allow(const_err)]
1716

@@ -24,7 +23,6 @@ const FOO: u8 = [5u8][1];
2423
//~^ ERROR array index out of bounds
2524
//~^^ ERROR array index out of bounds
2625

27-
#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
2826
fn main() {
2927
let a = -std::i8::MIN;
3028
//~^ WARN attempted to negate with overflow

src/test/compile-fail/const-eval-overflow.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(rustc_attrs)]
1211
#![allow(unused_imports)]
1312

1413
// Note: the relevant lint pass here runs before some of the constant
@@ -104,7 +103,6 @@ const VALS_U64: (u64, u64, u64, u64) =
104103
//~^ ERROR attempted to multiply with overflow
105104
);
106105

107-
#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
108106
fn main() {
109107
foo(VALS_I8);
110108
foo(VALS_I16);

src/test/run-fail/divide-by-zero.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
// error-pattern:attempted to divide by zero
1414

15-
#![feature(rustc_attrs)]
16-
#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
1715
fn main() {
1816
let y = 0;
1917
let _z = 1 / y;

src/test/run-fail/mod-zero.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
// error-pattern:attempted remainder with a divisor of zero
1414

15-
#![feature(rustc_attrs)]
16-
#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
1715
fn main() {
1816
let y = 0;
1917
let _z = 1 % y;

src/test/run-fail/overflowing-add.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
// compile-flags: -C debug-assertions
1515

1616

17-
#![feature(rustc_attrs)]
18-
#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
1917
fn main() {
2018
let _x = 200u8 + 200u8 + 200u8;
2119
}

src/test/run-fail/overflowing-lsh-1.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
#![warn(exceeding_bitshifts)]
1717

18-
#![feature(rustc_attrs)]
19-
#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
2018
fn main() {
2119
let _x = 1_i32 << 32;
2220
}

src/test/run-fail/overflowing-lsh-2.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
#![warn(exceeding_bitshifts)]
1717

18-
#![feature(rustc_attrs)]
19-
#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
2018
fn main() {
2119
let _x = 1 << -1;
2220
}

src/test/run-fail/overflowing-lsh-3.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
#![warn(exceeding_bitshifts)]
1717

18-
#![feature(rustc_attrs)]
19-
#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
2018
fn main() {
2119
let _x = 1_u64 << 64;
2220
}

src/test/run-fail/overflowing-lsh-4.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818

1919
#![warn(exceeding_bitshifts)]
2020

21-
#![feature(rustc_attrs)]
22-
#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
2321
fn main() {
2422
// this signals overflow when checking is on
2523
let x = 1_i8 << 17;

src/test/run-fail/overflowing-mul.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
// error-pattern:thread 'main' panicked at 'arithmetic operation overflowed'
1414
// compile-flags: -C debug-assertions
1515

16-
#![feature(rustc_attrs)]
17-
#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
1816
fn main() {
1917
let x = 200u8 * 4;
2018
}

0 commit comments

Comments
 (0)