Skip to content

Commit 41f2288

Browse files
committed
fix warnings in tests; update validation whitelist
1 parent 00c909d commit 41f2288

8 files changed

+6
-13
lines changed

src/librustc_mir/interpret/validation.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,17 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> {
5656
use regex::Regex;
5757
lazy_static! {
5858
static ref RE: Regex = Regex::new("^(\
59-
std::mem::uninitialized::|\
60-
std::mem::forget::|\
59+
(std|alloc::heap::__core)::mem::uninitialized::|\
60+
(std|alloc::heap::__core)::mem::forget::|\
6161
<(std|alloc)::heap::Heap as (std::heap|alloc::allocator)::Alloc>::|\
62-
<std::mem::ManuallyDrop<T>><.*>::new$|\
63-
<std::mem::ManuallyDrop<T> as std::ops::DerefMut><.*>::deref_mut$|\
64-
std::ptr::read::|\
62+
<(std|alloc::heap::__core)::mem::ManuallyDrop<T>><.*>::new$|\
63+
<(std|alloc::heap::__core)::mem::ManuallyDrop<T> as std::ops::DerefMut><.*>::deref_mut$|\
64+
(std|alloc::heap::__core)::ptr::read::|\
6565
\
6666
<std::sync::Arc<T>><.*>::inner$|\
6767
<std::sync::Arc<T>><.*>::drop_slow$|\
6868
(std::heap|alloc::allocator)::Layout::for_value::|\
69-
std::mem::(size|align)_of_val::\
69+
(std|alloc::heap::__core)::mem::(size|align)_of_val::\
7070
)").unwrap();
7171
}
7272
// Now test

tests/compile-fail/deallocate-bad-alignment.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use alloc::allocator::*;
77

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

10-
use alloc::heap::*;
1110
fn main() {
1211
unsafe {
1312
let x = Heap.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();

tests/compile-fail/deallocate-bad-size.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use alloc::allocator::*;
77

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

10-
use alloc::heap::*;
1110
fn main() {
1211
unsafe {
1312
let x = Heap.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();

tests/compile-fail/deallocate-twice.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use alloc::allocator::*;
77

88
// error-pattern: tried to deallocate dangling pointer
99

10-
use alloc::heap::*;
1110
fn main() {
1211
unsafe {
1312
let x = Heap.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();

tests/compile-fail/reallocate-bad-alignment-2.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use alloc::allocator::*;
77

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

10-
use alloc::heap::*;
1110
fn main() {
1211
unsafe {
1312
let x = Heap.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();

tests/compile-fail/reallocate-bad-alignment.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use alloc::allocator::*;
77

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

10-
use alloc::heap::*;
1110
fn main() {
1211
unsafe {
1312
let x = Heap.alloc(Layout::from_size_align_unchecked(1, 2)).unwrap();

tests/compile-fail/reallocate-bad-size.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use alloc::allocator::*;
77

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

10-
use alloc::heap::*;
1110
fn main() {
1211
unsafe {
1312
let x = Heap.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();

tests/compile-fail/reallocate-dangling.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use alloc::allocator::*;
77

88
// error-pattern: dangling pointer was dereferenced
99

10-
use alloc::heap::*;
1110
fn main() {
1211
unsafe {
1312
let x = Heap.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();

0 commit comments

Comments
 (0)