Changed tests
This commit is contained in:
parent
84556502e6
commit
5c45420bda
6 changed files with 19 additions and 40 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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`.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue