Skip to content

Commit

Permalink
fix warnings in tests; update validation whitelist
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Sep 9, 2017
1 parent caf25dc commit 3f152f3
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 13 deletions.
12 changes: 6 additions & 6 deletions src/librustc_mir/interpret/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> {
use regex::Regex;
lazy_static! {
static ref RE: Regex = Regex::new("^(\
std::mem::uninitialized::|\
std::mem::forget::|\
(std|alloc::heap::__core)::mem::uninitialized::|\
(std|alloc::heap::__core)::mem::forget::|\
<(std|alloc)::heap::Heap as (std::heap|alloc::allocator)::Alloc>::|\
<std::mem::ManuallyDrop<T>><.*>::new$|\
<std::mem::ManuallyDrop<T> as std::ops::DerefMut><.*>::deref_mut$|\
std::ptr::read::|\
<(std|alloc::heap::__core)::mem::ManuallyDrop<T>><.*>::new$|\
<(std|alloc::heap::__core)::mem::ManuallyDrop<T> as std::ops::DerefMut><.*>::deref_mut$|\
(std|alloc::heap::__core)::ptr::read::|\
\
<std::sync::Arc<T>><.*>::inner$|\
<std::sync::Arc<T>><.*>::drop_slow$|\
(std::heap|alloc::allocator)::Layout::for_value::|\
std::mem::(size|align)_of_val::\
(std|alloc::heap::__core)::mem::(size|align)_of_val::\
)").unwrap();
}
// Now test
Expand Down
1 change: 0 additions & 1 deletion tests/compile-fail/deallocate-bad-alignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use alloc::allocator::*;

// error-pattern: tried to deallocate or reallocate using incorrect alignment or size

use alloc::heap::*;
fn main() {
unsafe {
let x = Heap.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();
Expand Down
1 change: 0 additions & 1 deletion tests/compile-fail/deallocate-bad-size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use alloc::allocator::*;

// error-pattern: tried to deallocate or reallocate using incorrect alignment or size

use alloc::heap::*;
fn main() {
unsafe {
let x = Heap.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();
Expand Down
1 change: 0 additions & 1 deletion tests/compile-fail/deallocate-twice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use alloc::allocator::*;

// error-pattern: tried to deallocate dangling pointer

use alloc::heap::*;
fn main() {
unsafe {
let x = Heap.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();
Expand Down
1 change: 0 additions & 1 deletion tests/compile-fail/reallocate-bad-alignment-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use alloc::allocator::*;

// error-pattern: tried to deallocate or reallocate using incorrect alignment or size

use alloc::heap::*;
fn main() {
unsafe {
let x = Heap.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();
Expand Down
1 change: 0 additions & 1 deletion tests/compile-fail/reallocate-bad-alignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use alloc::allocator::*;

// error-pattern: tried to deallocate or reallocate using incorrect alignment or size

use alloc::heap::*;
fn main() {
unsafe {
let x = Heap.alloc(Layout::from_size_align_unchecked(1, 2)).unwrap();
Expand Down
1 change: 0 additions & 1 deletion tests/compile-fail/reallocate-bad-size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use alloc::allocator::*;

// error-pattern: tried to deallocate or reallocate using incorrect alignment or size

use alloc::heap::*;
fn main() {
unsafe {
let x = Heap.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();
Expand Down
1 change: 0 additions & 1 deletion tests/compile-fail/reallocate-dangling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use alloc::allocator::*;

// error-pattern: dangling pointer was dereferenced

use alloc::heap::*;
fn main() {
unsafe {
let x = Heap.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();
Expand Down

0 comments on commit 3f152f3

Please sign in to comment.