Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
75 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,68 @@ | ||
error: this expression will panic at runtime | ||
--> $DIR/promoted_errors.rs:7:14 | ||
error: attempt to subtract with overflow | ||
--> $DIR/promoted_errors.rs:6:20 | ||
| | ||
LL | let _x = 0u32 - 1; | ||
| ^^^^^^^^ attempt to subtract with overflow | ||
LL | println!("{}", 0u32 - 1); | ||
| ^^^^^^^^ | ||
| | ||
note: lint level defined here | ||
--> $DIR/promoted_errors.rs:3:9 | ||
| | ||
LL | #![deny(const_err)] | ||
| ^^^^^^^^^ | ||
|
||
error: attempt to subtract with overflow | ||
--> $DIR/promoted_errors.rs:8:14 | ||
| | ||
LL | let _x = 0u32 - 1; | ||
| ^^^^^^^^ | ||
|
||
error: attempt to divide by zero | ||
--> $DIR/promoted_errors.rs:9:20 | ||
--> $DIR/promoted_errors.rs:10:20 | ||
| | ||
LL | println!("{}", 1/(1-1)); | ||
| ^^^^^^^ | ||
|
||
error: reaching this expression at runtime will panic or abort | ||
--> $DIR/promoted_errors.rs:9:20 | ||
--> $DIR/promoted_errors.rs:10:20 | ||
| | ||
LL | println!("{}", 1/(1-1)); | ||
| ^^^^^^^ attempt to divide by zero | ||
|
||
error: attempt to divide by zero | ||
--> $DIR/promoted_errors.rs:12:14 | ||
--> $DIR/promoted_errors.rs:13:14 | ||
| | ||
LL | let _x = 1/(1-1); | ||
| ^^^^^^^ | ||
|
||
error: this expression will panic at runtime | ||
--> $DIR/promoted_errors.rs:12:14 | ||
--> $DIR/promoted_errors.rs:13:14 | ||
| | ||
LL | let _x = 1/(1-1); | ||
| ^^^^^^^ attempt to divide by zero | ||
|
||
error: attempt to divide by zero | ||
--> $DIR/promoted_errors.rs:15:20 | ||
--> $DIR/promoted_errors.rs:16:20 | ||
| | ||
LL | println!("{}", 1/(false as u32)); | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: reaching this expression at runtime will panic or abort | ||
--> $DIR/promoted_errors.rs:15:20 | ||
--> $DIR/promoted_errors.rs:16:20 | ||
| | ||
LL | println!("{}", 1/(false as u32)); | ||
| ^^^^^^^^^^^^^^^^ attempt to divide by zero | ||
|
||
error: attempt to divide by zero | ||
--> $DIR/promoted_errors.rs:18:14 | ||
--> $DIR/promoted_errors.rs:19:14 | ||
| | ||
LL | let _x = 1/(false as u32); | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: this expression will panic at runtime | ||
--> $DIR/promoted_errors.rs:18:14 | ||
--> $DIR/promoted_errors.rs:19:14 | ||
| | ||
LL | let _x = 1/(false as u32); | ||
| ^^^^^^^^^^^^^^^^ attempt to divide by zero | ||
|
||
error: aborting due to 9 previous errors | ||
error: aborting due to 10 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
// compile-flags: -C overflow-checks=on -O | ||
// run-pass | ||
|
||
fn main() { | ||
let _ = -(-0.0); | ||
//~^ ERROR: this expression will panic at runtime | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.