]> git.lizzy.rs Git - rust.git/blobdiff - src/intptrcast.rs
bump miri dependencies
[rust.git] / src / intptrcast.rs
index c908bdf24ebac0a633d9fba88e5a0b8d5e121c94..0e6a9f69aebab656228929959ae560419325dd48 100644 (file)
@@ -6,7 +6,6 @@
 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::*;
@@ -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`.
@@ -93,7 +92,7 @@ pub fn ptr_to_int(
                 let slack = {
                     let mut rng = memory.extra.rng.borrow_mut();
                     // This means that `(global_state.next_base_addr + slack) % 16` is uniformly distributed.
-                    rng.gen_range(016)
+                    rng.gen_range(0..16)
                 };
                 // From next_base_addr + slack, round up to adjust for alignment.
                 let base_addr = global_state.next_base_addr.checked_add(slack).unwrap();