From 238501c13736962451b07d16481cc36c39144072 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 25 Jun 2022 23:46:51 -0400 Subject: interpret: adjust error from constructing an invalid value --- compiler/rustc_middle/src/mir/interpret/error.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'compiler') diff --git a/compiler/rustc_middle/src/mir/interpret/error.rs b/compiler/rustc_middle/src/mir/interpret/error.rs index 65de64c6328..a33a2921f57 100644 --- a/compiler/rustc_middle/src/mir/interpret/error.rs +++ b/compiler/rustc_middle/src/mir/interpret/error.rs @@ -373,9 +373,11 @@ impl fmt::Display for UndefinedBehaviorInfo<'_> { ), WriteToReadOnly(a) => write!(f, "writing to {} which is read-only", a), DerefFunctionPointer(a) => write!(f, "accessing {} which contains a function", a), - ValidationFailure { path: None, msg } => write!(f, "type validation failed: {}", msg), + ValidationFailure { path: None, msg } => { + write!(f, "constructing invalid value: {}", msg) + } ValidationFailure { path: Some(path), msg } => { - write!(f, "type validation failed at {}: {}", path, msg) + write!(f, "constructing invalid value at {}: {}", path, msg) } InvalidBool(b) => { write!(f, "interpreting an invalid 8-bit value as a bool: 0x{:02x}", b) -- cgit 1.4.1-3-g733a5