We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
ScalarInt
1 parent 2e53625 commit 97bfff1Copy full SHA for 97bfff1
compiler/rustc_middle/src/ty/consts/int.rs
@@ -1,4 +1,3 @@
1
-use crate::mir::interpret::InterpResult;
2
use rustc_apfloat::ieee::{Double, Single};
3
use rustc_apfloat::Float;
4
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
@@ -192,11 +191,11 @@ impl ScalarInt {
192
191
self.data == 0
193
}
194
195
- pub(crate) fn ptr_sized_op<'tcx>(
+ pub(crate) fn ptr_sized_op<E>(
196
self,
197
dl: &TargetDataLayout,
198
- f_int: impl FnOnce(u64) -> InterpResult<'tcx, u64>,
199
- ) -> InterpResult<'tcx, Self> {
+ f_int: impl FnOnce(u64) -> Result<u64, E>,
+ ) -> Result<Self, E> {
200
assert_eq!(u64::from(self.size), dl.pointer_size.bytes());
201
Ok(Self::try_from_uint(f_int(u64::try_from(self.data).unwrap())?, self.size()).unwrap())
202
0 commit comments