]> git.lizzy.rs Git - rust.git/commitdiff
fix many tests and ignore some others; enable compile_fail tests again
authorRalf Jung <post@ralfj.de>
Wed, 11 Jul 2018 19:07:17 +0000 (21:07 +0200)
committerRalf Jung <post@ralfj.de>
Thu, 12 Jul 2018 08:22:23 +0000 (10:22 +0200)
13 files changed:
tests/compile-fail-fullmir/undefined_byte_read.rs
tests/compile-fail/deallocate-bad-alignment.rs
tests/compile-fail/deallocate-bad-size.rs
tests/compile-fail/deallocate-twice.rs
tests/compile-fail/match_char.rs
tests/compile-fail/memleak.rs
tests/compile-fail/memleak_rc.rs
tests/compile-fail/overflowing-rsh-2.rs
tests/compile-fail/reallocate-bad-size.rs
tests/compile-fail/reallocate-change-alloc.rs
tests/compile-fail/reallocate-dangling.rs
tests/compile-fail/static_memory_modification.rs
tests/compiletest.rs

index 99404b7d5f3f54e52f01b264a6cadb4008e6abfd..24718bce7db96bb04147b4e13fe8a480dabcb43e 100644 (file)
@@ -4,6 +4,7 @@
 fn main() {
     let v: Vec<u8> = Vec::with_capacity(10);
     let undef = unsafe { *v.get_unchecked(5) };
-    let x = undef + 1; //~ ERROR: attempted to read undefined bytes
+    let x = undef + 1; //~ ERROR: error
+    //~^ NOTE attempted to read undefined bytes
     panic!("this should never print: {}", x);
 }
index 36e99cb11f72538c603695fbe6610771d759d85d..4b89f0ac70c79a6b7cc793c410280758a48257e5 100644 (file)
@@ -9,7 +9,7 @@
 
 fn main() {
     unsafe {
-        let x = Global.alloc(Layout::from_size_align_unchecked(1, 1));
+        let x = Global.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();
         Global.dealloc(x, Layout::from_size_align_unchecked(1, 2));
     }
 }
index f1271cefd1ac14044df20a16fe50cbaf39820672..3a74245816c469afdee9f172fd699e23a5934fd3 100644 (file)
@@ -9,7 +9,7 @@
 
 fn main() {
     unsafe {
-        let x = Global.alloc(Layout::from_size_align_unchecked(1, 1));
+        let x = Global.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();
         Global.dealloc(x, Layout::from_size_align_unchecked(2, 1));
     }
 }
index 58fcb7409495ca3dccd24acaf7076feaabea4b17..613edf3c6af95d81768c7e9ee0d269a5ee464e4e 100644 (file)
@@ -9,7 +9,7 @@
 
 fn main() {
     unsafe {
-        let x = Global.alloc(Layout::from_size_align_unchecked(1, 1));
+        let x = Global.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();
         Global.dealloc(x, Layout::from_size_align_unchecked(1, 1));
         Global.dealloc(x, Layout::from_size_align_unchecked(1, 1));
     }
index 15ce2f2f79525912bca237d72d1d8325ba4c51ef..0d45d70eb781ac7564c209fd3564a61642deca33 100644 (file)
@@ -1,3 +1,5 @@
+// ignore-test FIXME: we are not checking these things on match any more?
+
 fn main() {
     assert!(std::char::from_u32(-1_i32 as u32).is_none());
     match unsafe { std::mem::transmute::<i32, char>(-1) } { //~ ERROR constant evaluation error [E0080]
index 71b4e2f442f31db02b4d710d3ede9917c51f9dcc..c03cf50eb27f613f6100a24ef02163c61a8cfe70 100644 (file)
@@ -1,3 +1,4 @@
+// ignore-test FIXME: leak detection is disabled
 //error-pattern: the evaluated program leaked memory
 
 fn main() {
index b2bc6722afb04fd22c6a0bc4b546ecab3fe1e5ac..da3a58118a2a5671f295b67f0af108889988c70a 100644 (file)
@@ -1,3 +1,4 @@
+// ignore-test FIXME: leak detection is disabled
 //error-pattern: the evaluated program leaked memory
 
 use std::rc::Rc;
index 4447b9d7579a7b9e2d91de423bbd909c64bef5f8..967c8b020cca099781347a769c233d13f45d4585 100644 (file)
@@ -13,5 +13,5 @@
 fn main() {
     // Make sure we catch overflows that would be hidden by first casting the RHS to u32
     let _n = 1i64 >> (u32::max_value() as i64 + 1); //~ ERROR constant evaluation error [E0080]
-    //~^ NOTE suiriuruihrihue
+    //~^ NOTE attempt to shift right with overflow
 }
index d75c195d521e0f766c5d562198282c9a5af2158d..f85b651e857304a41e774244b288fbd2a98e6c74 100644 (file)
@@ -9,7 +9,7 @@
 
 fn main() {
     unsafe {
-        let x = Global.alloc(Layout::from_size_align_unchecked(1, 1));
-        let _y = Global.realloc(x, Layout::from_size_align_unchecked(2, 1), 1);
+        let x = Global.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();
+        let _y = Global.realloc(x, Layout::from_size_align_unchecked(2, 1), 1).unwrap();
     }
 }
index d8234e933300b5dba91d91f0795101b5e0e45a43..03040cd178da2009010ad0ae5ef816bd7f849fea 100644 (file)
@@ -7,9 +7,9 @@
 
 fn main() {
     unsafe {
-        let x = Global.alloc(Layout::from_size_align_unchecked(1, 1));
-        let _y = Global.realloc(x, Layout::from_size_align_unchecked(1, 1), 1);
-        let _z = *(x as *mut u8); //~ ERROR constant evaluation error [E0080]
+        let x = Global.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();
+        let _y = Global.realloc(x, Layout::from_size_align_unchecked(1, 1), 1).unwrap();
+        let _z = *(x.as_ptr() as *mut u8); //~ ERROR constant evaluation error [E0080]
         //~^ NOTE dangling pointer was dereferenced
     }
 }
index 39b60407160e4fa8c61fdf289b499026d47c257d..6dfb7fe2b9663b6cc637e58514ff8a079d06c37c 100644 (file)
@@ -9,8 +9,8 @@
 
 fn main() {
     unsafe {
-        let x = Global.alloc(Layout::from_size_align_unchecked(1, 1));
+        let x = Global.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();
         Global.dealloc(x, Layout::from_size_align_unchecked(1, 1));
-        Global.realloc(x, Layout::from_size_align_unchecked(1, 1), 1);
+        Global.realloc(x, Layout::from_size_align_unchecked(1, 1), 1).unwrap();
     }
 }
index 7182f40d994dd834ebd3f581d2e1fba49c5ec25c..a85ff545ee4239e36552db4e5df696acf8b579fd 100644 (file)
@@ -1,3 +1,4 @@
+// ignore-test FIXME: we are not making these statics read-only any more?
 static X: usize = 5;
 
 #[allow(mutable_transmutes)]
index 342ea92280de038510c008fa5218fffd8f90e7ca..401499f6c5fa744999222de391d30d56190a6660 100644 (file)
@@ -192,7 +192,9 @@ fn run_pass_miri_noopt() {
 }
 
 #[test]
-#[ignore] // FIXME: Disabled for now, as the optimizer is pretty broken and crashes...
+#[ignore]
+// FIXME: Disabled for now, as the optimizer is pretty broken and crashes...
+// See https://github.com/rust-lang/rust/issues/50411
 fn run_pass_miri_opt() {
     run_pass_miri(true);
 }
@@ -204,13 +206,11 @@ fn run_pass_rustc() {
 }
 
 #[test]
-#[should_panic] // TODO: update test errors
 fn compile_fail_miri() {
     let sysroot = get_sysroot();
     let host = get_host();
 
     // FIXME: run tests for other targets, too
     compile_fail(&sysroot, "tests/compile-fail", &host, &host, true);
-
     compile_fail(&sysroot, "tests/compile-fail-fullmir", &host, &host, true);
 }