Skip to content

Commit

Permalink
Unrolled build for rust-lang#127179
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
rust-timer committed Jul 7, 2024
2 parents 959a2eb + 69446e3 commit 2b2fb74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/core/src/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ impl hash::Hash for TypeId {
#[stable(feature = "rust1", since = "1.0.0")]
impl fmt::Debug for TypeId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
f.debug_tuple("TypeId").field(&self.as_u128()).finish()
write!(f, "TypeId({:#034x})", self.as_u128())
}
}

Expand Down

0 comments on commit 2b2fb74

Please sign in to comment.