use hex for invalid bool and char (consistently with validation)
This commit is contained in:
parent
707bd7b213
commit
cce0cb3c39
1 changed files with 6 additions and 2 deletions
|
@ -438,8 +438,12 @@ 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(ref err) => write!(f, "type validation failed: {}", err),
|
||||
InvalidBool(b) => write!(f, "interpreting an invalid 8-bit value as a bool: {}", b),
|
||||
InvalidChar(c) => write!(f, "interpreting an invalid 32-bit value as a char: {}", c),
|
||||
InvalidBool(b) => {
|
||||
write!(f, "interpreting an invalid 8-bit value as a bool: 0x{:2x}", b)
|
||||
}
|
||||
InvalidChar(c) => {
|
||||
write!(f, "interpreting an invalid 32-bit value as a char: 0x{:8x}", c)
|
||||
}
|
||||
InvalidDiscriminant(val) => write!(f, "enum value has invalid discriminant: {}", val),
|
||||
InvalidFunctionPointer(p) => {
|
||||
write!(f, "using {} as function pointer but it does not point to a function", p)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue