diff --git a/rust-version b/rust-version index ea30c4512e..a2909dd328 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -nightly-2018-12-24 +nightly-2018-12-26 diff --git a/src/operator.rs b/src/operator.rs index e1ccdf9199..cc803c4ea9 100644 --- a/src/operator.rs +++ b/src/operator.rs @@ -145,8 +145,8 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for super::MiriEvalContext<'a, 'mir, ' // Dead allocations in miri cannot overlap with live allocations, but // on read hardware this can easily happen. Thus for comparisons we require // both pointers to be live. - self.memory().get(left.alloc_id)?.check_bounds_ptr(left)?; - self.memory().get(right.alloc_id)?.check_bounds_ptr(right)?; + self.memory().check_bounds_ptr(left, InboundsCheck::Live)?; + self.memory().check_bounds_ptr(right, InboundsCheck::Live)?; // Two in-bounds pointers, we can compare across allocations left == right } @@ -161,12 +161,14 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for super::MiriEvalContext<'a, 'mir, ' if bits == 0 { // Test if the ptr is in-bounds. Then it cannot be NULL. // Even dangling pointers cannot be NULL. - if self.memory().check_bounds_ptr_maybe_dead(ptr).is_ok() { + if self.memory().check_bounds_ptr(ptr, InboundsCheck::MaybeDead).is_ok() { return Ok(false); } } - let (alloc_size, alloc_align) = self.memory().get_size_and_align(ptr.alloc_id); + let (alloc_size, alloc_align) = self.memory() + .get_size_and_align(ptr.alloc_id, InboundsCheck::MaybeDead) + .expect("determining size+align of dead ptr cannot fail"); // Case II: Alignment gives it away if ptr.offset.bytes() % alloc_align.bytes() == 0 { diff --git a/tests/run-pass/async-fn.rs b/tests/run-pass/async-fn.rs index 7c32b026df..9094a9fd3a 100644 --- a/tests/run-pass/async-fn.rs +++ b/tests/run-pass/async-fn.rs @@ -2,7 +2,6 @@ async_await, await_macro, futures_api, - pin, )] use std::{future::Future, pin::Pin, task::Poll}; diff --git a/tests/run-pass/function_pointers.rs b/tests/run-pass/function_pointers.rs index 6819a2af3e..cc888630d3 100644 --- a/tests/run-pass/function_pointers.rs +++ b/tests/run-pass/function_pointers.rs @@ -44,4 +44,5 @@ fn main() { let g = f as fn() -> i32; assert!(return_fn_ptr(g) == g); assert!(return_fn_ptr(g) as unsafe fn() -> i32 == g as fn() -> i32 as unsafe fn() -> i32); + assert!(return_fn_ptr(f) != f); }