diff options
| author | Oli Scherer <github333195615777966@oli-obk.de> | 2025-05-28 10:29:08 +0000 |
|---|---|---|
| committer | Oli Scherer <github333195615777966@oli-obk.de> | 2025-06-02 15:37:15 +0000 |
| commit | b331b8b96d86a6433df957a3cc49ed51f3656135 (patch) | |
| tree | 72e20ae9fa73a475719589593a790156181e4e24 /tests/ui/error-codes | |
| parent | e6152cdf5b31bd844a4cc1049433859d54863602 (diff) | |
| download | rust-b331b8b96d86a6433df957a3cc49ed51f3656135.tar.gz rust-b331b8b96d86a6433df957a3cc49ed51f3656135.zip | |
Use the informative error as the main const eval error message
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..da364332a70 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 -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 error: aborting due to 2 previous errors |
