Use unsigned_abs throughout repository
This commit is contained in:
parent
85394252e6
commit
edf2e3725e
5 changed files with 6 additions and 15 deletions
|
@ -1,4 +1,4 @@
|
|||
use super::{uabs, AllocId, InterpResult};
|
||||
use super::{AllocId, InterpResult};
|
||||
|
||||
use rustc_macros::HashStable;
|
||||
use rustc_target::abi::{HasDataLayout, Size};
|
||||
|
@ -57,7 +57,7 @@ pub trait PointerArithmetic: HasDataLayout {
|
|||
#[inline]
|
||||
fn overflowing_signed_offset(&self, val: u64, i: i64) -> (u64, bool) {
|
||||
// We need to make sure that i fits in a machine isize.
|
||||
let n = uabs(i);
|
||||
let n = i.unsigned_abs();
|
||||
if i >= 0 {
|
||||
let (val, over) = self.overflowing_offset(val, n);
|
||||
(val, over || i > self.machine_isize_max())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue