X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fintptrcast.rs;h=188ff94861bdd194a223f092f5c24149c276b725;hb=2670839e1af540a496a0d889fce9ad42529ecc11;hp=f51c8a7ce7439e0864f8fd3e4aefa0c8c8a7e785;hpb=d606172f32a4ca6c6ce73147760ee0ca1ed439b9;p=rust.git diff --git a/src/intptrcast.rs b/src/intptrcast.rs index f51c8a7ce74..188ff94861b 100644 --- a/src/intptrcast.rs +++ b/src/intptrcast.rs @@ -6,10 +6,9 @@ use rand::Rng; use rustc_data_structures::fx::FxHashMap; -use rustc_mir::interpret::{AllocCheck, AllocId, InterpResult, Memory, Machine, Pointer, PointerArithmetic}; use rustc_target::abi::{Size, HasDataLayout}; -use crate::{Evaluator, Tag, STACK_ADDR, CheckInAllocMsg}; +use crate::*; pub type MemoryExtra = RefCell; @@ -79,7 +78,7 @@ pub fn ptr_to_int( ) -> InterpResult<'tcx, u64> { let mut global_state = memory.extra.intptrcast.borrow_mut(); let global_state = &mut *global_state; - let id = Evaluator::canonical_alloc_id(memory, ptr.alloc_id); + let id = ptr.alloc_id; // There is nothing wrong with a raw pointer being cast to an integer only after // it became dangling. Hence `MaybeDead`.