Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 0347ca7

Browse files
committed
Explain why we forward to self-printing during self-printing
1 parent d1074ed commit 0347ca7

File tree

1 file changed

+2
-1
lines changed
  • compiler/rustc_middle/src/ty/consts

1 file changed

+2
-1
lines changed

compiler/rustc_middle/src/ty/consts/int.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl ScalarInt {
194194
f_int: impl FnOnce(u64) -> InterpResult<'tcx, u64>,
195195
) -> InterpResult<'tcx, Self> {
196196
assert_eq!(u64::from(self.size), dl.pointer_size.bytes());
197-
Ok(Self::try_from_uint(f_int(u64::try_from(self.data).unwrap())?, self.size).unwrap())
197+
Ok(Self::try_from_uint(f_int(u64::try_from(self.data).unwrap())?, self.size()).unwrap())
198198
}
199199

200200
#[inline]
@@ -328,6 +328,7 @@ impl fmt::Debug for ScalarInt {
328328
self.check_data();
329329
write!(f, "<ZST>")
330330
} else {
331+
// Dispatch to LowerHex below.
331332
write!(f, "0x{:x}", self)
332333
}
333334
}

0 commit comments

Comments
 (0)