From 7e7b5d42ba321aa4cc3da5e1da222344597b0c1d Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 24 Jun 2019 14:50:27 +0200 Subject: [PATCH] Apply suggestions from code review Co-Authored-By: Oliver Scherer --- src/operator.rs | 2 +- tests/compile-fail/zst3.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/operator.rs b/src/operator.rs index 5d1f33a5709..cb258cf150d 100644 --- a/src/operator.rs +++ b/src/operator.rs @@ -193,7 +193,7 @@ fn ptr_eq( // on read hardware this can easily happen. Thus for comparisons we require // both pointers to be live. if self.pointer_inbounds(left).is_ok() && self.pointer_inbounds(right).is_ok() { - // Two in-bounds pointers in different allocatons are different. + // Two in-bounds pointers in different allocations are different. false } else { return err!(InvalidPointerMath); diff --git a/tests/compile-fail/zst3.rs b/tests/compile-fail/zst3.rs index a16ec0186d7..c94591174ec 100644 --- a/tests/compile-fail/zst3.rs +++ b/tests/compile-fail/zst3.rs @@ -7,7 +7,7 @@ fn main() { // (that are out-of-bounds). let mut x_box = Box::new(1u8); let x = (&mut *x_box as *mut u8).wrapping_offset(1); - // This one is just "at the egde", but still okay + // This one is just "at the edge", but still okay unsafe { *(x as *mut [u8; 0]) = zst_val; } // One byte further is OOB. let x = x.wrapping_offset(1); -- 2.44.0