diff options
| author | oli <github35764891676564198441@oli-obk.de> | 2020-11-01 17:14:09 +0000 |
|---|---|---|
| committer | oli <github35764891676564198441@oli-obk.de> | 2020-11-04 10:12:55 +0000 |
| commit | d1074edb64723092e06ba5267b9482422e569b7b (patch) | |
| tree | 9dc0f0376b504901cb31cd17b581b930d330bb09 | |
| parent | 8282d526e0dc7d59b4c939c2a4d66858ab0dfcc0 (diff) | |
catch conversion errors during `ptr_sized_op`
| -rw-r--r-- | compiler/rustc_middle/src/ty/consts/int.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/ty/consts/int.rs b/compiler/rustc_middle/src/ty/consts/int.rs index f9593c367b9..ec84bff18cd 100644 --- a/compiler/rustc_middle/src/ty/consts/int.rs +++ b/compiler/rustc_middle/src/ty/consts/int.rs @@ -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 { data: u128::from(f_int(u64::try_from(self.data).unwrap())?), size: self.size }) + Ok(Self::try_from_uint(f_int(u64::try_from(self.data).unwrap())?, self.size).unwrap()) } #[inline] |
