From 1bab6a4db788abae8c06cfa3cb19b0027e9cd8bf Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 1 May 2020 14:39:41 +0200 Subject: [PATCH] fix Miri error message padding --- src/librustc_middle/mir/interpret/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustc_middle/mir/interpret/error.rs b/src/librustc_middle/mir/interpret/error.rs index 40454ce3b2db8..0ab14b53e1b1f 100644 --- a/src/librustc_middle/mir/interpret/error.rs +++ b/src/librustc_middle/mir/interpret/error.rs @@ -439,10 +439,10 @@ impl fmt::Display for UndefinedBehaviorInfo { DerefFunctionPointer(a) => write!(f, "accessing {} which contains a function", a), ValidationFailure(ref err) => write!(f, "type validation failed: {}", err), InvalidBool(b) => { - write!(f, "interpreting an invalid 8-bit value as a bool: 0x{:2x}", b) + write!(f, "interpreting an invalid 8-bit value as a bool: 0x{:02x}", b) } InvalidChar(c) => { - write!(f, "interpreting an invalid 32-bit value as a char: 0x{:8x}", c) + write!(f, "interpreting an invalid 32-bit value as a char: 0x{:08x}", c) } InvalidDiscriminant(val) => write!(f, "enum value has invalid discriminant: {}", val), InvalidFunctionPointer(p) => {