From 2be159bacdbad72dc9e89eaa7a79bf8576c103cd Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 11 Aug 2017 09:12:46 -0700 Subject: [PATCH 1/2] enable a test that waited for a rustc fix --- tests/run-pass-fullmir/integer-ops.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/run-pass-fullmir/integer-ops.rs b/tests/run-pass-fullmir/integer-ops.rs index 44030c3301..e761cdd623 100644 --- a/tests/run-pass-fullmir/integer-ops.rs +++ b/tests/run-pass-fullmir/integer-ops.rs @@ -9,8 +9,7 @@ // except according to those terms. // FIXME: remove -Zmir-opt-level once https://github.com/rust-lang/rust/issues/43359 is fixed -// FIXME: remove -Zmir-emit-validate=0 once https://github.com/rust-lang/rust/pull/43748 is merged -// compile-flags: -Zmir-opt-level=0 -Zmir-emit-validate=0 +// compile-flags: -Zmir-opt-level=0 use std::i32; From 7e5d971c56f22f94a27bf87a307cfa191e7c98f5 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 12 Aug 2017 09:45:44 -0700 Subject: [PATCH 2/2] fix warnings; make test suite pass again --- src/librustc_mir/interpret/memory.rs | 2 +- src/librustc_mir/interpret/value.rs | 1 - tests/run-pass/pointers.rs | 2 +- tests/run-pass/thread-local.rs | 4 ++-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/librustc_mir/interpret/memory.rs b/src/librustc_mir/interpret/memory.rs index 56c051dcfa..9930555c19 100644 --- a/src/librustc_mir/interpret/memory.rs +++ b/src/librustc_mir/interpret/memory.rs @@ -1454,7 +1454,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> Memory<'a, 'tcx, M> { return Ok(()); } let ptr = ptr.to_ptr()?; - let mut alloc = self.get_mut(ptr.alloc_id)?; + let alloc = self.get_mut(ptr.alloc_id)?; alloc.undef_mask.set_range( ptr.offset, ptr.offset + size, diff --git a/src/librustc_mir/interpret/value.rs b/src/librustc_mir/interpret/value.rs index 8424e72fef..8abb0b86bf 100644 --- a/src/librustc_mir/interpret/value.rs +++ b/src/librustc_mir/interpret/value.rs @@ -1,5 +1,4 @@ #![allow(unknown_lints)] -#![allow(float_cmp)] use rustc::ty::layout::HasDataLayout; diff --git a/tests/run-pass/pointers.rs b/tests/run-pass/pointers.rs index 2ef7eb0102..f3ae3ab913 100644 --- a/tests/run-pass/pointers.rs +++ b/tests/run-pass/pointers.rs @@ -34,7 +34,7 @@ fn tuple_ref_mut() -> (i8, i8) { fn match_ref_mut() -> i8 { let mut t = (20, 22); { - let mut opt = Some(&mut t); + let opt = Some(&mut t); match opt { Some(&mut (ref mut x, ref mut y)) => *x += *y, None => {}, diff --git a/tests/run-pass/thread-local.rs b/tests/run-pass/thread-local.rs index 34aeef23b1..db00e42d99 100644 --- a/tests/run-pass/thread-local.rs +++ b/tests/run-pass/thread-local.rs @@ -29,10 +29,10 @@ pub fn record(r: usize) { unsafe { RECORD = RECORD*10 + r }; } -unsafe extern fn dtor(mut ptr: *mut u64) { +unsafe extern fn dtor(ptr: *mut u64) { assert!(CANNARY != 0 as *mut _); // make sure we do not get run too often let val = *ptr; - + let which_key = GLOBALS.iter().position(|global| global as *const _ == ptr).expect("Should find my global"); record(which_key);