Skip to content

Commit 97bfff1

Browse files
committed
Make ScalarInt entirely independent of MIR interpretation
1 parent 2e53625 commit 97bfff1

File tree

1 file changed

+3
-4
lines changed
  • compiler/rustc_middle/src/ty/consts

1 file changed

+3
-4
lines changed

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

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use crate::mir::interpret::InterpResult;
21
use rustc_apfloat::ieee::{Double, Single};
32
use rustc_apfloat::Float;
43
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
@@ -192,11 +191,11 @@ impl ScalarInt {
192191
self.data == 0
193192
}
194193

195-
pub(crate) fn ptr_sized_op<'tcx>(
194+
pub(crate) fn ptr_sized_op<E>(
196195
self,
197196
dl: &TargetDataLayout,
198-
f_int: impl FnOnce(u64) -> InterpResult<'tcx, u64>,
199-
) -> InterpResult<'tcx, Self> {
197+
f_int: impl FnOnce(u64) -> Result<u64, E>,
198+
) -> Result<Self, E> {
200199
assert_eq!(u64::from(self.size), dl.pointer_size.bytes());
201200
Ok(Self::try_from_uint(f_int(u64::try_from(self.data).unwrap())?, self.size()).unwrap())
202201
}

0 commit comments

Comments
 (0)