Print TypeId as hex for debugging · model-checking/verify-rust-std@986dbd1 (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Commit 986dbd1

Print TypeId as hex for debugging

In <rust-lang#127134>, the `Debug` impl for `TypeId` was changed to print a single integer rather than a tuple. Change this again to print as hex for more concise and consistent formatting, as was suggested. Result: TypeId(0x1378bb1c0a0202683eb65e7c11f2e4d7)

File tree

1 file changed

lines changed

1 file changed

lines changed

Lines changed: 1 addition & 1 deletion

Original file line number Diff line number Diff line change
@@ -673,7 +673,7 @@ impl hash::Hash for TypeId {
673 673 #[stable(feature = "rust1", since = "1.0.0")]
674 674 impl fmt::Debug for TypeId {
675 675 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
676 -f.debug_tuple("TypeId").field(&self.as_u128()).finish()
676 +write!(f, "TypeId({:#034x})", self.as_u128())
677 677 }
678 678 }
679 679