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/rustdoc-ui | |
| 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/rustdoc-ui')
| -rw-r--r-- | tests/rustdoc-ui/const-evalutation-ice.rs | 4 | ||||
| -rw-r--r-- | tests/rustdoc-ui/const-evalutation-ice.stderr | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/rustdoc-ui/const-evalutation-ice.rs b/tests/rustdoc-ui/const-evalutation-ice.rs index 0dd3bcaa289..72bcbeb4c51 100644 --- a/tests/rustdoc-ui/const-evalutation-ice.rs +++ b/tests/rustdoc-ui/const-evalutation-ice.rs @@ -4,8 +4,8 @@ use std::cell::Cell; use std::mem; pub struct S { - s: Cell<usize> + s: Cell<usize>, } pub const N: usize = 0 - (mem::size_of::<S>() != 400) as usize; -//~^ ERROR evaluation of constant value failed +//~^ ERROR overflow diff --git a/tests/rustdoc-ui/const-evalutation-ice.stderr b/tests/rustdoc-ui/const-evalutation-ice.stderr index e1cb3323856..2410782000d 100644 --- a/tests/rustdoc-ui/const-evalutation-ice.stderr +++ b/tests/rustdoc-ui/const-evalutation-ice.stderr @@ -1,8 +1,8 @@ -error[E0080]: evaluation of constant value failed +error[E0080]: attempt to compute `0_usize - 1_usize`, which would overflow --> $DIR/const-evalutation-ice.rs:10:22 | LL | pub const N: usize = 0 - (mem::size_of::<S>() != 400) as usize; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of constant value failed here error: aborting due to 1 previous error |
