Skip to content

Commit

Permalink
Changed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleywiser committed Aug 22, 2019
1 parent 8455650 commit 5c45420
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 38 deletions.
2 changes: 1 addition & 1 deletion src/test/incremental/hashes/for_loops.rs
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/consts/array-literal-index-oob.rs
Expand Up @@ -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
}
8 changes: 1 addition & 7 deletions src/test/ui/consts/array-literal-index-oob.stderr
Expand Up @@ -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
|
Expand All @@ -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

8 changes: 4 additions & 4 deletions src/test/ui/consts/const-eval/issue-43197.stderr
Expand Up @@ -21,16 +21,16 @@ 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
--> $DIR/issue-43197.rs:12:23
|
LL | println!("{} {}", X, Y);
| ^ referenced constant has errors
| ^ referenced constant has errors

error[E0080]: evaluation of constant expression failed
--> $DIR/issue-43197.rs:12:23
--> $DIR/issue-43197.rs:12:26
|
LL | println!("{} {}", X, Y);
| ^ referenced constant has errors
| ^ referenced constant has errors

error: aborting due to 2 previous errors

Expand Down
6 changes: 2 additions & 4 deletions src/test/ui/consts/const-eval/promoted_errors.rs
Expand Up @@ -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
Expand Down
30 changes: 9 additions & 21 deletions src/test/ui/consts/const-eval/promoted_errors.stderr
Expand Up @@ -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

0 comments on commit 5c45420

Please sign in to comment.