mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
adjust run-fail tests
This commit is contained in:
parent
0c8c800f21
commit
3134df2214
@ -2,7 +2,7 @@
|
||||
|
||||
const C: [u32; 5] = [0; 5];
|
||||
|
||||
#[allow(const_err)]
|
||||
#[allow(panic, const_err)]
|
||||
fn test() -> u32 {
|
||||
C[10]
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
const C: &'static [u8; 5] = b"hello";
|
||||
|
||||
#[allow(const_err)]
|
||||
#[allow(panic, const_err)]
|
||||
fn test() -> u8 {
|
||||
C[10]
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
const C: &'static [u8; 5] = b"hello";
|
||||
|
||||
#[allow(const_err)]
|
||||
#[allow(panic, const_err)]
|
||||
fn mir() -> u8 {
|
||||
C[10]
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// error-pattern:thread 'main' panicked at 'attempt to add with overflow'
|
||||
// compile-flags: -C debug-assertions
|
||||
|
||||
#![allow(const_err)]
|
||||
#![allow(overflow)]
|
||||
|
||||
fn main() {
|
||||
let _x = 200u8 + 200u8 + 200u8;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// error-pattern:thread 'main' panicked at 'attempt to multiply with overflow'
|
||||
// compile-flags: -C debug-assertions
|
||||
|
||||
#![allow(const_err)]
|
||||
#![allow(overflow)]
|
||||
|
||||
fn main() {
|
||||
let x = 200u8 * 4;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// error-pattern:thread 'main' panicked at 'attempt to negate with overflow'
|
||||
// compile-flags: -C debug-assertions
|
||||
|
||||
#![allow(const_err)]
|
||||
#![allow(overflow)]
|
||||
|
||||
fn main() {
|
||||
let _x = -std::i8::MIN;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// error-pattern:thread 'main' panicked at 'attempt to subtract with overflow'
|
||||
// compile-flags: -C debug-assertions
|
||||
|
||||
#![allow(const_err)]
|
||||
#![allow(overflow)]
|
||||
|
||||
fn main() {
|
||||
let _x = 42u8 - (42u8 + 1);
|
||||
|
@ -1,4 +1,4 @@
|
||||
#![allow(const_err)]
|
||||
#![allow(panic, const_err)]
|
||||
|
||||
// error-pattern: attempt to divide by zero
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#![allow(const_err)]
|
||||
#![allow(overflow)]
|
||||
|
||||
// error-pattern: overflow
|
||||
// compile-flags: -C overflow-checks=yes
|
||||
|
Loading…
Reference in New Issue
Block a user