From b331b8b96d86a6433df957a3cc49ed51f3656135 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Wed, 28 May 2025 10:29:08 +0000 Subject: Use the informative error as the main const eval error message --- tests/rustdoc-ui/const-evalutation-ice.rs | 4 ++-- tests/rustdoc-ui/const-evalutation-ice.stderr | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/rustdoc-ui') 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 + s: Cell, } pub const N: usize = 0 - (mem::size_of::() != 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..7fb78b6a028 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::() != 400) as usize; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of constant value failed error: aborting due to 1 previous error -- cgit 1.4.1-3-g733a5