Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2b2fb74

Browse files
authoredJul 7, 2024
Unrolled build for rust-lang#127179
Rollup merge of rust-lang#127179 - tgross35:typeid-debug-hex, r=Nilstrieb 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)
2 parents 959a2eb + 69446e3 commit 2b2fb74

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎library/core/src/any.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ impl hash::Hash for TypeId {
673673
#[stable(feature = "rust1", since = "1.0.0")]
674674
impl fmt::Debug for TypeId {
675675
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())
677677
}
678678
}
679679

0 commit comments

Comments
 (0)
Failed to load comments.