diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-06-03 21:53:37 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-03 21:53:37 +0200 |
| commit | f574c0edb5a505d5b462c5fe02fb149120984730 (patch) | |
| tree | 3de696eb5d64c1144b9a9a35a3c177112cc02e96 /tests/ui/error-codes | |
| parent | 644f06ec1fd8b17de40d42c699a61020db02a123 (diff) | |
| parent | 020216c31c1e4f1f56a689df8f04580504354613 (diff) | |
| download | rust-f574c0edb5a505d5b462c5fe02fb149120984730.tar.gz rust-f574c0edb5a505d5b462c5fe02fb149120984730.zip | |
Rollup merge of #141698 - oli-obk:ctfe-err-flip, r=RalfJung
Use the informative error as the main const eval error message r? `@RalfJung` I only did the minimal changes necessary to the const eval error machinery. I'd prefer not to mix test changes with refactorings 😆
Diffstat (limited to 'tests/ui/error-codes')
| -rw-r--r-- | tests/ui/error-codes/E0080.rs | 9 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0080.stderr | 12 |
2 files changed, 9 insertions, 12 deletions
diff --git a/tests/ui/error-codes/E0080.rs b/tests/ui/error-codes/E0080.rs index 55f45055f01..0d19f02a9f1 100644 --- a/tests/ui/error-codes/E0080.rs +++ b/tests/ui/error-codes/E0080.rs @@ -1,9 +1,6 @@ enum Enum { - X = (1 << 500), //~ ERROR E0080 - //~| NOTE attempt to shift left by `500_i32`, which would overflow - Y = (1 / 0) //~ ERROR E0080 - //~| NOTE attempt to divide `1_isize` by zero + X = (1 << 500), //~ ERROR attempt to shift left by `500_i32`, which would overflow + Y = (1 / 0), //~ ERROR attempt to divide `1_isize` by zero } -fn main() { -} +fn main() {} diff --git a/tests/ui/error-codes/E0080.stderr b/tests/ui/error-codes/E0080.stderr index 60ed9a4358f..431d4e04454 100644 --- a/tests/ui/error-codes/E0080.stderr +++ b/tests/ui/error-codes/E0080.stderr @@ -1,14 +1,14 @@ -error[E0080]: evaluation of constant value failed +error[E0080]: attempt to shift left by `500_i32`, which would overflow --> $DIR/E0080.rs:2:9 | LL | X = (1 << 500), - | ^^^^^^^^^^ attempt to shift left by `500_i32`, which would overflow + | ^^^^^^^^^^ evaluation of constant value failed here -error[E0080]: evaluation of constant value failed - --> $DIR/E0080.rs:4:9 +error[E0080]: attempt to divide `1_isize` by zero + --> $DIR/E0080.rs:3:9 | -LL | Y = (1 / 0) - | ^^^^^^^ attempt to divide `1_isize` by zero +LL | Y = (1 / 0), + | ^^^^^^^ evaluation of constant value failed here error: aborting due to 2 previous errors |
