diff options
| author | bors <bors@rust-lang.org> | 2022-06-29 22:21:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-06-29 22:21:43 +0000 |
| commit | bf45371f262e184b4a77adea88c8ac01ac79759b (patch) | |
| tree | 7696b9f583e79522bf701e29d0d936ecb7783e14 /compiler | |
| parent | ddcbba036aee08f0709f98a92a342a278eae5c05 (diff) | |
| parent | 549940c491baabbaf6b5f2e3b0c9028bbb866e97 (diff) | |
| download | rust-bf45371f262e184b4a77adea88c8ac01ac79759b.tar.gz rust-bf45371f262e184b4a77adea88c8ac01ac79759b.zip | |
Auto merge of #98520 - RalfJung:invalid, r=compiler-errors
interpret: adjust error from constructing an invalid value
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_middle/src/mir/interpret/error.rs | 6 |
1 files changed, 4 insertions, 2 deletions
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) |
