Skip to content

Commit 6d3f7a9

Browse files
committed
Enable the overflow-related tests for MIR
1 parent 196de1a commit 6d3f7a9

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,15 +11,13 @@
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

1817
fn black_box<T>(_: T) {
1918
unimplemented!()
2019
}
2120

22-
#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
2321
fn main() {
2422
let a = -std::i8::MIN;
2523
//~^ 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
}

src/test/run-fail/overflowing-neg.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 'attempted to negate with overflow'
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 = -std::i8::MIN;
2018
}

src/test/run-fail/overflowing-rsh-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-rsh-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_i32 >> -1;
2220
}

src/test/run-fail/overflowing-rsh-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_i64 >> 64;
2220
}

src/test/run-fail/overflowing-rsh-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 = 2_i8 >> 17;

src/test/run-fail/overflowing-rsh-5.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 _n = 1i64 >> [64][0];
2220
}

src/test/run-fail/overflowing-rsh-6.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
#![warn(exceeding_bitshifts)]
1717
#![feature(const_indexing)]
1818

19-
#![feature(rustc_attrs)]
20-
#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
2119
fn main() {
2220
let _n = 1i64 >> [64][0];
2321
}

src/test/run-fail/overflowing-sub.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 = 42u8 - (42u8 + 1);
2018
}

src/test/run-make/debug-assertions/debug.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ fn debug_assert() {
3737
}
3838

3939
fn overflow() {
40-
#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
4140
fn add(a: u8, b: u8) -> u8 { a + b }
4241

4342
add(200u8, 200u8);

src/test/run-pass/issue-8460.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ use std::thread;
1919
macro_rules! check {
2020
($($e:expr),*) => {
2121
$(assert!(thread::spawn({
22-
#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
2322
move|| { $e; }
2423
}).join().is_err());)*
2524
}
2625
}
2726

28-
#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
2927
fn main() {
3028
check![
3129
isize::min_value() / -1,

0 commit comments

Comments
 (0)