Changed tests

This commit is contained in:
Wesley Wiser 2019-08-04 22:23:32 -04:00
parent 84556502e6
commit 5c45420bda
6 changed files with 19 additions and 40 deletions

View file

@ -94,7 +94,7 @@ pub fn change_iterable() {
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir")]
#[rustc_clean(cfg="cfail2", except="HirBody, mir_built")]
#[rustc_clean(cfg="cfail3")]
pub fn change_iterable() {
let mut _x = 0;

View file

@ -2,5 +2,4 @@ fn main() {
&{[1, 2, 3][4]};
//~^ ERROR index out of bounds
//~| ERROR reaching this expression at runtime will panic or abort
//~| ERROR this expression will panic at runtime
}

View file

@ -6,12 +6,6 @@ LL | &{[1, 2, 3][4]};
|
= note: `#[deny(const_err)]` on by default
error: this expression will panic at runtime
--> $DIR/array-literal-index-oob.rs:2:5
|
LL | &{[1, 2, 3][4]};
| ^^^^^^^^^^^^^^^ index out of bounds: the len is 3 but the index is 4
error: reaching this expression at runtime will panic or abort
--> $DIR/array-literal-index-oob.rs:2:7
|
@ -20,5 +14,5 @@ LL | &{[1, 2, 3][4]};
| |
| index out of bounds: the len is 3 but the index is 4
error: aborting due to 3 previous errors
error: aborting due to 2 previous errors

View file

@ -20,18 +20,18 @@ LL | const Y: u32 = foo(0-1);
| |
| attempt to subtract with overflow
error[E0080]: evaluation of constant expression failed
--> $DIR/issue-43197.rs:12:26
|
LL | println!("{} {}", X, Y);
| ^ referenced constant has errors
error[E0080]: evaluation of constant expression failed
--> $DIR/issue-43197.rs:12:23
|
LL | println!("{} {}", X, Y);
| ^ referenced constant has errors
error[E0080]: evaluation of constant expression failed
--> $DIR/issue-43197.rs:12:26
|
LL | println!("{} {}", X, Y);
| ^ referenced constant has errors
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.

View file

@ -7,15 +7,13 @@ fn main() {
let _x = 0u32 - 1;
//~^ ERROR this expression will panic at runtime [const_err]
println!("{}", 1/(1-1));
//~^ ERROR this expression will panic at runtime [const_err]
//~| ERROR attempt to divide by zero [const_err]
//~^ ERROR attempt to divide by zero [const_err]
//~| ERROR reaching this expression at runtime will panic or abort [const_err]
let _x = 1/(1-1);
//~^ ERROR const_err
//~| ERROR const_err
println!("{}", 1/(false as u32));
//~^ ERROR this expression will panic at runtime [const_err]
//~| ERROR attempt to divide by zero [const_err]
//~^ ERROR attempt to divide by zero [const_err]
//~| ERROR reaching this expression at runtime will panic or abort [const_err]
let _x = 1/(false as u32);
//~^ ERROR const_err

View file

@ -16,59 +16,47 @@ error: attempt to divide by zero
LL | println!("{}", 1/(1-1));
| ^^^^^^^
error: this expression will panic at runtime
error: reaching this expression at runtime will panic or abort
--> $DIR/promoted_errors.rs:9:20
|
LL | println!("{}", 1/(1-1));
| ^^^^^^^ attempt to divide by zero
error: attempt to divide by zero
--> $DIR/promoted_errors.rs:13:14
--> $DIR/promoted_errors.rs:12:14
|
LL | let _x = 1/(1-1);
| ^^^^^^^
error: this expression will panic at runtime
--> $DIR/promoted_errors.rs:13:14
--> $DIR/promoted_errors.rs:12:14
|
LL | let _x = 1/(1-1);
| ^^^^^^^ attempt to divide by zero
error: attempt to divide by zero
--> $DIR/promoted_errors.rs:16:20
--> $DIR/promoted_errors.rs:15:20
|
LL | println!("{}", 1/(false as u32));
| ^^^^^^^^^^^^^^^^
error: this expression will panic at runtime
--> $DIR/promoted_errors.rs:16:20
error: reaching this expression at runtime will panic or abort
--> $DIR/promoted_errors.rs:15:20
|
LL | println!("{}", 1/(false as u32));
| ^^^^^^^^^^^^^^^^ attempt to divide by zero
error: attempt to divide by zero
--> $DIR/promoted_errors.rs:20:14
--> $DIR/promoted_errors.rs:18:14
|
LL | let _x = 1/(false as u32);
| ^^^^^^^^^^^^^^^^
error: this expression will panic at runtime
--> $DIR/promoted_errors.rs:20:14
--> $DIR/promoted_errors.rs:18:14
|
LL | let _x = 1/(false as u32);
| ^^^^^^^^^^^^^^^^ attempt to divide by zero
error: reaching this expression at runtime will panic or abort
--> $DIR/promoted_errors.rs:16:20
|
LL | println!("{}", 1/(false as u32));
| ^^^^^^^^^^^^^^^^ attempt to divide by zero
error: reaching this expression at runtime will panic or abort
--> $DIR/promoted_errors.rs:9:20
|
LL | println!("{}", 1/(1-1));
| ^^^^^^^ attempt to divide by zero
error: aborting due to 11 previous errors
error: aborting due to 9 previous errors