Skip to content

Commit

Permalink
Explain why we forward to self-printing during self-printing
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Nov 4, 2020
1 parent d1074ed commit 0347ca7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/rustc_middle/src/ty/consts/int.rs
Expand Up @@ -194,7 +194,7 @@ impl ScalarInt {
f_int: impl FnOnce(u64) -> InterpResult<'tcx, u64>,
) -> InterpResult<'tcx, Self> {
assert_eq!(u64::from(self.size), dl.pointer_size.bytes());
Ok(Self::try_from_uint(f_int(u64::try_from(self.data).unwrap())?, self.size).unwrap())
Ok(Self::try_from_uint(f_int(u64::try_from(self.data).unwrap())?, self.size()).unwrap())
}

#[inline]
Expand Down Expand Up @@ -328,6 +328,7 @@ impl fmt::Debug for ScalarInt {
self.check_data();
write!(f, "<ZST>")
} else {
// Dispatch to LowerHex below.
write!(f, "0x{:x}", self)
}
}
Expand Down

0 comments on commit 0347ca7

Please sign in to comment.