Use generic NonZero internally.
This commit is contained in:
@@ -61,7 +61,7 @@ use std::fmt::Debug;
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::marker::PhantomData;
|
||||
use std::mem;
|
||||
use std::num::NonZeroUsize;
|
||||
use std::num::NonZero;
|
||||
use std::ops::ControlFlow;
|
||||
use std::ptr::NonNull;
|
||||
use std::{fmt, str};
|
||||
@@ -618,7 +618,7 @@ impl<'tcx> Term<'tcx> {
|
||||
#[inline]
|
||||
pub fn unpack(self) -> TermKind<'tcx> {
|
||||
let ptr = unsafe {
|
||||
self.ptr.map_addr(|addr| NonZeroUsize::new_unchecked(addr.get() & !TAG_MASK))
|
||||
self.ptr.map_addr(|addr| NonZero::<usize>::new_unchecked(addr.get() & !TAG_MASK))
|
||||
};
|
||||
// SAFETY: use of `Interned::new_unchecked` here is ok because these
|
||||
// pointers were originally created from `Interned` types in `pack()`,
|
||||
|
||||
Reference in New Issue
Block a user