about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2017-08-02 15:35:44 -0700
committerRalf Jung <post@ralfj.de>2017-08-03 18:13:23 -0700
commit4957031e3cf2333ae5c5519ffd03237eb4ca426c (patch)
tree2426d040d4a6aab851771dfbf313ebd22cd5fd7c
parent9458111681490cf8fcf1d7768f82a34ea9a89f4c (diff)
downloadrust-4957031e3cf2333ae5c5519ffd03237eb4ca426c.tar.gz
rust-4957031e3cf2333ae5c5519ffd03237eb4ca426c.zip
selectively disable validation in compile-fail where appropriate. cargo test now passes :)
-rw-r--r--tests/compile-fail/cast_box_int_to_fn_ptr.rs3
-rw-r--r--tests/compile-fail/cast_int_to_fn_ptr.rs3
-rw-r--r--tests/compile-fail/execute_memory.rs3
-rw-r--r--tests/compile-fail/fn_ptr_offset.rs3
-rw-r--r--tests/compile-fail/invalid_enum_discriminant.rs3
-rw-r--r--tests/compile-fail/memleak_rc.rs3
-rw-r--r--tests/compile-fail/static_memory_modification2.rs3
7 files changed, 21 insertions, 0 deletions
diff --git a/tests/compile-fail/cast_box_int_to_fn_ptr.rs b/tests/compile-fail/cast_box_int_to_fn_ptr.rs
index 96469814be2..912b1bd7d91 100644
--- a/tests/compile-fail/cast_box_int_to_fn_ptr.rs
+++ b/tests/compile-fail/cast_box_int_to_fn_ptr.rs
@@ -1,3 +1,6 @@
+// Validation makes this fail in the wrong place
+// compile-flags: -Zmir-emit-validate=0
+
 fn main() {
     let b = Box::new(42);
     let g = unsafe {
diff --git a/tests/compile-fail/cast_int_to_fn_ptr.rs b/tests/compile-fail/cast_int_to_fn_ptr.rs
index 28d56a2cb62..23f85dbaf3e 100644
--- a/tests/compile-fail/cast_int_to_fn_ptr.rs
+++ b/tests/compile-fail/cast_int_to_fn_ptr.rs
@@ -1,3 +1,6 @@
+// Validation makes this fail in the wrong place
+// compile-flags: -Zmir-emit-validate=0
+
 fn main() {
     let g = unsafe {
         std::mem::transmute::<usize, fn(i32)>(42)
diff --git a/tests/compile-fail/execute_memory.rs b/tests/compile-fail/execute_memory.rs
index 8d3c9df0320..87d975e1f9d 100644
--- a/tests/compile-fail/execute_memory.rs
+++ b/tests/compile-fail/execute_memory.rs
@@ -1,3 +1,6 @@
+// Validation makes this fail in the wrong place
+// compile-flags: -Zmir-emit-validate=0
+
 #![feature(box_syntax)]
 
 fn main() {
diff --git a/tests/compile-fail/fn_ptr_offset.rs b/tests/compile-fail/fn_ptr_offset.rs
index 2d240b6a55a..3e4c5d6ad39 100644
--- a/tests/compile-fail/fn_ptr_offset.rs
+++ b/tests/compile-fail/fn_ptr_offset.rs
@@ -1,3 +1,6 @@
+// Validation makes this fail in the wrong place
+// compile-flags: -Zmir-emit-validate=0
+
 use std::mem;
 
 fn f() {}
diff --git a/tests/compile-fail/invalid_enum_discriminant.rs b/tests/compile-fail/invalid_enum_discriminant.rs
index bde78200b3c..9ce6d44ca46 100644
--- a/tests/compile-fail/invalid_enum_discriminant.rs
+++ b/tests/compile-fail/invalid_enum_discriminant.rs
@@ -1,3 +1,6 @@
+// Validation makes this fail in the wrong place
+// compile-flags: -Zmir-emit-validate=0
+
 #[repr(C)]
 pub enum Foo {
     A, B, C, D
diff --git a/tests/compile-fail/memleak_rc.rs b/tests/compile-fail/memleak_rc.rs
index b2bc6722afb..ee245daa310 100644
--- a/tests/compile-fail/memleak_rc.rs
+++ b/tests/compile-fail/memleak_rc.rs
@@ -1,3 +1,6 @@
+// FIXME: Due to https://github.com/rust-lang/rust/issues/43457 we have to disable validation
+// compile-flags: -Zmir-emit-validate=0
+
 //error-pattern: the evaluated program leaked memory
 
 use std::rc::Rc;
diff --git a/tests/compile-fail/static_memory_modification2.rs b/tests/compile-fail/static_memory_modification2.rs
index 89d69cf7d7f..f030a9c281d 100644
--- a/tests/compile-fail/static_memory_modification2.rs
+++ b/tests/compile-fail/static_memory_modification2.rs
@@ -1,3 +1,6 @@
+// Validation detects that we are casting & to &mut and so it changes why we fail
+// compile-flags: -Zmir-emit-validate=0
+
 use std::mem::transmute;
 
 #[allow(mutable_transmutes)]