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

Commit d1074ed

Browse files
committed
catch conversion errors during ptr_sized_op
1 parent 8282d52 commit d1074ed

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 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 { data: u128::from(f_int(u64::try_from(self.data).unwrap())?), size: self.size })
197+
Ok(Self::try_from_uint(f_int(u64::try_from(self.data).unwrap())?, self.size).unwrap())
198198
}
199199

200200
#[inline]

0 commit comments

Comments
 (0)