]> git.lizzy.rs Git - rust.git/commitdiff
don't use NOTE in tests
authorRalf Jung <post@ralfj.de>
Fri, 19 Oct 2018 09:50:17 +0000 (11:50 +0200)
committerRalf Jung <post@ralfj.de>
Fri, 19 Oct 2018 10:29:49 +0000 (12:29 +0200)
36 files changed:
tests/compile-fail-fullmir/reallocate-change-alloc.rs
tests/compile-fail/alignment.rs
tests/compile-fail/assume.rs
tests/compile-fail/bitop-beyond-alignment.rs
tests/compile-fail/cast_box_int_to_fn_ptr.rs
tests/compile-fail/cast_int_to_fn_ptr.rs
tests/compile-fail/dangling_pointer_deref.rs
tests/compile-fail/div-by-zero-2.rs
tests/compile-fail/execute_memory.rs
tests/compile-fail/fn_ptr_offset.rs
tests/compile-fail/modifying_constants.rs
tests/compile-fail/never_say_never.rs
tests/compile-fail/never_transmute_void.rs
tests/compile-fail/out_of_bounds_read.rs
tests/compile-fail/out_of_bounds_read2.rs
tests/compile-fail/overflowing-lsh-neg.rs
tests/compile-fail/overflowing-rsh-2.rs
tests/compile-fail/overflowing-rsh.rs
tests/compile-fail/overwriting_part_of_relocation_makes_the_rest_undefined.rs
tests/compile-fail/pointer_byte_read_2.rs
tests/compile-fail/pointers_to_different_allocations_are_unorderable.rs
tests/compile-fail/ptr_int_cast.rs
tests/compile-fail/reading_half_a_pointer.rs
tests/compile-fail/reference_to_packed.rs
tests/compile-fail/static_memory_modification.rs
tests/compile-fail/static_memory_modification2.rs
tests/compile-fail/static_memory_modification3.rs
tests/compile-fail/transmute-pair-undef.rs
tests/compile-fail/transmute_fat.rs
tests/compile-fail/transmute_fat2.rs
tests/compile-fail/unaligned_ptr_cast.rs
tests/compile-fail/unaligned_ptr_cast2.rs
tests/compile-fail/unaligned_ptr_cast_zst.rs
tests/compile-fail/undefined_byte_read.rs
tests/compile-fail/wild_pointer_deref.rs
tests/compile-fail/zst.rs

index c73f86bc1721ce6fb00922785062faa3900caac0..1e2178811ea3ab5babedceeb0b7b7f4ad63adc84 100644 (file)
@@ -9,7 +9,6 @@ fn main() {
     unsafe {
         let x = Global.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();
         Global.realloc(x, Layout::from_size_align_unchecked(1, 1), 1).unwrap();
-        let _z = *(x.as_ptr() as *mut u8); //~ ERROR constant evaluation error
-        //~^ NOTE dangling pointer was dereferenced
+        let _z = *(x.as_ptr() as *mut u8); //~ ERROR dangling pointer was dereferenced
     }
 }
index 71161f5d6da0036360ac4d590f6b11f14d7b486b..4faaa359df6244fe57a8d6c00301d735f0dfbafe 100644 (file)
@@ -5,8 +5,7 @@ fn main() {
     let x_ptr: *mut u8 = &mut x[0];
     let y_ptr = x_ptr as *mut u64;
     unsafe {
-        *y_ptr = 42; //~ ERROR constant evaluation error
-        //~^ NOTE tried to access memory with alignment 1, but alignment
+        *y_ptr = 42; //~ ERROR tried to access memory with alignment 1, but alignment
     }
     panic!("unreachable in miri");
 }
index d9eec480cd0c613a1df6e309619526d4c37f1afc..3026124e1f9aff69ac8e4b5f5777f7bd019b3bf1 100644 (file)
@@ -5,7 +5,6 @@ fn main() {
     unsafe {
         std::intrinsics::assume(x < 10);
         std::intrinsics::assume(x > 1);
-        std::intrinsics::assume(x > 42); //~ ERROR constant evaluation error
-    //~^ NOTE `assume` argument was false
+        std::intrinsics::assume(x > 42); //~ `assume` argument was false
     }
 }
index c8cbc9a9184163361d933f05d563aa72ba30566d..a30c054ab5d0486fd57255dd86bebc03a2918c25 100644 (file)
@@ -28,11 +28,10 @@ fn mk_rec() -> Rec {
 fn is_u64_aligned(u: &Tag<u64>) -> bool {
     let p: usize = unsafe { mem::transmute(u) };
     let u64_align = std::mem::align_of::<u64>();
-    return (p & (u64_align + 1)) == 0; //~ ERROR constant evaluation error
-    //~^ NOTE a raw memory access tried to access part of a pointer value as raw bytes
+    return (p & (u64_align + 1)) == 0; //~ ERROR a raw memory access tried to access part of a pointer value as raw bytes
 }
 
 pub fn main() {
     let x = mk_rec();
-    assert!(is_u64_aligned(&x.t)); //~ NOTE inside call to `is_u64_aligned
+    assert!(is_u64_aligned(&x.t));
 }
index cbf370e0236300addd9a3df43b951f29c9e12cbd..c3b1fa595888519c45cea7f3e62858138482be85 100644 (file)
@@ -7,6 +7,5 @@ fn main() {
         std::mem::transmute::<&usize, &fn(i32)>(&b)
     };
 
-    (*g)(42) //~ ERROR constant evaluation error
-    //~^ NOTE a memory access tried to interpret some bytes as a pointer
+    (*g)(42) //~ ERROR a memory access tried to interpret some bytes as a pointer
 }
index 2a08d9f1f9f85080fabd5bec569f188b1bb9d3ad..1971ce1557e7957e3cf6a40608f0690721204c8a 100644 (file)
@@ -6,6 +6,5 @@ fn main() {
         std::mem::transmute::<usize, fn(i32)>(42)
     };
 
-    g(42) //~ ERROR constant evaluation error
-    //~^ NOTE a memory access tried to interpret some bytes as a pointer
+    g(42) //~ ERROR a memory access tried to interpret some bytes as a pointer
 }
index 434f5c780b46f0c00897109f93c6c71391750b0e..e8072077305730ef3a7a17ee09760c533ee0290f 100644 (file)
@@ -3,7 +3,6 @@ fn main() {
         let b = Box::new(42);
         &*b as *const i32
     };
-    let x = unsafe { *p }; //~ ERROR constant evaluation error
-    //~^ NOTE dangling pointer was dereferenced
+    let x = unsafe { *p }; //~ ERROR dangling pointer was dereferenced
     panic!("this should never print: {}", x);
 }
index 94145c2cf32f37c7b0d5f8084a56bcca7e731719..181a41ce3b23e2b44d0fb6740fca8d8fcafba879 100644 (file)
@@ -11,6 +11,5 @@
 #![allow(const_err)]
 
 fn main() {
-    let _n = 1 / 0; //~ ERROR constant evaluation error
-    //~^ NOTE attempt to divide by zero
+    let _n = 1 / 0; //~ ERROR attempt to divide by zero
 }
index 2f8fea38d8f9f984463bfa085767417327c7f400..d859e9072e3246f2a9692bd3c95c491f64ab4f0a 100644 (file)
@@ -7,7 +7,6 @@ fn main() {
     let x = box 42;
     unsafe {
         let f = std::mem::transmute::<Box<i32>, fn()>(x);
-        f() //~ ERROR constant evaluation error
-        //~^ NOTE tried to treat a memory pointer as a function pointer
+        f() //~ ERROR tried to treat a memory pointer as a function pointer
     }
 }
index e6d1da1e0736a9dc2b6d5e049a5303c38cf6c54b..cccb21790d6505eda4c4dada728c57c10f1cbd2b 100644 (file)
@@ -10,6 +10,5 @@ fn main() {
     let y : *mut u8 = unsafe { mem::transmute(x) };
     let y = y.wrapping_offset(1);
     let x : fn() = unsafe { mem::transmute(y) };
-    x(); //~ ERROR constant evaluation error
-    //~^ NOTE tried to use a function pointer after offsetting it
+    x(); //~ ERROR tried to use a function pointer after offsetting it
 }
index ba46651f58ee4f25e90a2c9a2820d157a45fa142..27c74e8dc87ee27b640f5c03c35e0bb6019d52a0 100644 (file)
@@ -2,7 +2,6 @@
 fn main() {
     let x = &1; // the `&1` is promoted to a constant, but it used to be that only the pointer is marked static, not the pointee
     let y = unsafe { &mut *(x as *const i32 as *mut i32) };
-    *y = 42;  //~ ERROR constant evaluation error
-    //~^ NOTE tried to modify constant memory
+    *y = 42;  //~ ERROR tried to modify constant memory
     assert_eq!(*x, 42);
 }
index 9821723deb3bc828eb4686d1a24be57649dee8a4..634488489b539a0d2f911f0f243e769353ba8cf6 100644 (file)
@@ -7,8 +7,7 @@
 fn main() {
     let y = &5;
     let x: ! = unsafe {
-        *(y as *const _ as *const !)  //~ ERROR constant evaluation error
-        //~^ NOTE entered unreachable code
+        *(y as *const _ as *const !)  //~ ERROR entered unreachable code
     };
     f(x)
 }
index 11fc0f068de0d80104f54df2c5c5739ae61bc386..5620b6559cfde40a7d0abf7decd1c584951c0f3a 100644 (file)
@@ -8,8 +8,7 @@
 enum Void {}
 
 fn f(v: Void) -> ! {
-    match v {} //~ ERROR constant evaluation error
-    //~^ NOTE entered unreachable code
+    match v {} //~ ERROR  entered unreachable code
 }
 
 fn main() {
index 3ccdb365feebc737b11d81ba660b7f6edd8c1f92..1ab2d9714779273262c2d666111ec4d25ec0546d 100644 (file)
@@ -1,6 +1,5 @@
 fn main() {
     let v: Vec<u8> = vec![1, 2];
-    let x = unsafe { *v.as_ptr().wrapping_offset(5) }; //~ ERROR constant evaluation error
-    //~^ NOTE which has size 2
+    let x = unsafe { *v.as_ptr().wrapping_offset(5) }; //~ ERROR outside bounds of allocation
     panic!("this should never print: {}", x);
 }
index e8bcf4558401ce583df48d3b9c1faf66de159f58..1ab2d9714779273262c2d666111ec4d25ec0546d 100644 (file)
@@ -1,6 +1,5 @@
 fn main() {
     let v: Vec<u8> = vec![1, 2];
-    let x = unsafe { *v.as_ptr().wrapping_offset(5) }; //~ ERROR constant evaluation error
-    //~^ NOTE outside bounds of allocation
+    let x = unsafe { *v.as_ptr().wrapping_offset(5) }; //~ ERROR outside bounds of allocation
     panic!("this should never print: {}", x);
 }
index 825a82226634910216c007766e454901d8ebb3d7..8c70c9c7df7ddfd5c3192ec81bca0480227be8f0 100644 (file)
@@ -12,6 +12,5 @@
 #![allow(const_err)]
 
 fn main() {
-    let _n = 2i64 << -1; //~ ERROR constant evaluation error
-    //~^ NOTE attempt to shift left with overflow
+    let _n = 2i64 << -1; //~ ERROR attempt to shift left with overflow
 }
index cf107a76ae29dba95bab4a82c1d28bc4e34dd053..7b7486343c3358de3531561e1a999ff4d78c33fe 100644 (file)
@@ -12,6 +12,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
-    //~^ NOTE attempt to shift right with overflow
+    let _n = 1i64 >> (u32::max_value() as i64 + 1); //~ ERROR attempt to shift right with overflow
 }
index ea53d7e730925e94d2e77fc1fbcab3a223421edd..355cbd86988883983f695193223923fafce6e549 100644 (file)
@@ -11,6 +11,5 @@
 #![allow(exceeding_bitshifts)]
 
 fn main() {
-    let _n = 1i64 >> 64; //~ ERROR constant evaluation error
-    //~^ NOTE attempt to shift right with overflow
+    let _n = 1i64 >> 64; //~ ERROR attempt to shift right with overflow
 }
index 7c38c05746983d07d72a9b715d55684392f9403b..5c0d5b463d51f4502a318537d3e17f5bf6a61b67 100644 (file)
@@ -6,7 +6,6 @@ fn main() {
         // "attempted to interpret some raw bytes as a pointer address" instead of
         // "attempted to read undefined bytes"
     }
-    let x = *p; //~ ERROR constant evaluation error
-    //~^ NOTE attempted to read undefined bytes
+    let x = *p; //~ ERROR attempted to read undefined bytes
     panic!("this should never print: {}", x);
 }
index c8a1a2e10f5004fa8200f65b0bd544c29b067089..5df8c4782c7f88fcc2e00b102d38d5d836c6871b 100644 (file)
@@ -3,6 +3,5 @@ fn main() {
     let y = &x;
     let z = &y as *const &i32 as *const u8;
     // the deref fails, because we are reading only a part of the pointer
-    let _ = unsafe { *z }; //~ ERROR constant evaluation error
-    //~^ NOTE tried to access part of a pointer value as raw bytes
+    let _ = unsafe { *z }; //~ ERROR tried to access part of a pointer value as raw bytes
 }
index 89cf357e201cff0675f1bb49475202040e48b26e..124f84de5bf45b6186719f3e39f204bde9051e64 100644 (file)
@@ -1,8 +1,7 @@
 fn main() {
     let x: *const u8 = &1;
     let y: *const u8 = &2;
-    if x < y { //~ ERROR constant evaluation error
-    //~^ NOTE attempted to do invalid arithmetic on pointers
+    if x < y { //~ ERROR attempted to do invalid arithmetic on pointers
         unreachable!()
     }
 }
index 11243921bfd48e5f8f615192f071a4e8c1984475..576f0c333d189d3992177c9750a03c8054552389 100644 (file)
@@ -2,8 +2,7 @@ fn main() {
     let x = &1;
     // Casting down to u8 and back up to a pointer loses too much precision; this must not work.
     let x = x as *const i32;
-    let x = x as u8; //~ ERROR constant evaluation error
-    //~^ NOTE a raw memory access tried to access part of a pointer value as raw bytes
+    let x = x as u8; //~ ERROR a raw memory access tried to access part of a pointer value as raw bytes
     let x = x as *const i32;
     let _ = unsafe { *x };
 }
index 3ea693a3f0fbbf63dded626048c7635633942b0b..049dfca340ed986b13e7a9e593165e75eedb52e0 100644 (file)
@@ -24,7 +24,6 @@ fn main() {
     // starts 1 byte to the right, so using it would actually be wrong!
     let d_alias = &mut w.data as *mut _ as *mut *const u8;
     unsafe {
-        let _x = *d_alias; //~ ERROR constant evaluation error
-        //~^ NOTE tried to access part of a pointer value as raw bytes
+        let _x = *d_alias; //~ ERROR tried to access part of a pointer value as raw bytes
     }
 }
index d18f314c8aaa168c3d75628a17613783fd1bba15..14a2afc33f7fec26f376d0699e05707dcdd757ee 100644 (file)
@@ -15,6 +15,5 @@ fn main() {
         y: 99,
     };
     let p = unsafe { &foo.x };
-    let i = *p; //~ ERROR constant evaluation error
-    //~^ NOTE tried to access memory with alignment 1, but alignment 4 is required
+    let i = *p; //~ ERROR tried to access memory with alignment 1, but alignment 4 is required
 }
index 9e39c2c01c2b20cfdc674424c343de86ada771f7..304ab6c6b7409310c42d3c906135fb1d4445ebce 100644 (file)
@@ -3,8 +3,7 @@
 #[allow(mutable_transmutes)]
 fn main() {
     unsafe {
-        *std::mem::transmute::<&usize, &mut usize>(&X) = 6; //~ ERROR constant evaluation error
-        //~^ NOTE tried to modify constant memory
+        *std::mem::transmute::<&usize, &mut usize>(&X) = 6; //~ ERROR tried to modify constant memory
         assert_eq!(X, 6);
     }
 }
index 2f702f09c8047e736ee5cf10dcd97e03be72567d..01c3b9bb2d8da9395e11fc07d601ce1d40beaad9 100644 (file)
@@ -7,7 +7,6 @@
 fn main() {
     unsafe {
         let s = "this is a test";
-        transmute::<&[u8], &mut [u8]>(s.as_bytes())[4] = 42; //~ ERROR constant evaluation error
-        //~^ NOTE tried to modify constant memory
+        transmute::<&[u8], &mut [u8]>(s.as_bytes())[4] = 42; //~ ERROR tried to modify constant memory
     }
 }
index 37d8bfe02ceb2bc8be2d954c65063fad0f7eaa38..ff09aad1bd5643e6da5e108cd89a065660b0d24c 100644 (file)
@@ -4,7 +4,6 @@
 fn main() {
     unsafe {
         let bs = b"this is a test";
-        transmute::<&[u8], &mut [u8]>(bs)[4] = 42; //~ ERROR constant evaluation error
-        //~^ NOTE tried to modify constant memory
+        transmute::<&[u8], &mut [u8]>(bs)[4] = 42; //~ ERROR tried to modify constant memory
     }
 }
index 9509bb60e8b112126f7b820684b7c7bbbc6131a1..acc6098af7ee04a2c638d71b23fab120e9e91d78 100644 (file)
@@ -16,6 +16,5 @@ fn main() {
         assert_eq!(byte, 0);
     }
     let v = unsafe { *z.offset(first_undef) };
-    if v == 0 {} //~ ERROR constant evaluation error
-    //~^ NOTE attempted to read undefined bytes
+    if v == 0 {} //~ ERROR attempted to read undefined bytes
 }
index 3e3bf51c3f2771fe3d0233ef70129a59f85ce2f8..e1f916910d732f52d066e7e0e69ac35e1a425644 100644 (file)
@@ -10,6 +10,5 @@ fn main() {
     let bad = unsafe {
         std::mem::transmute::<&[u8], [u8; 8]>(&[1u8])
     };
-    let _ = bad[0] + bad[bad.len()-1]; //~ ERROR constant evaluation error
-    //~^ NOTE a raw memory access tried to access part of a pointer value as raw bytes
+    let _ = bad[0] + bad[bad.len()-1]; //~ ERROR a raw memory access tried to access part of a pointer value as raw bytes
 }
index e9e21a84294dc5795d8dc6f776b1e6d87ff8e53a..3121a139d9204878d352c79417a57eba36c13d18 100644 (file)
@@ -7,6 +7,5 @@ fn main() {
     let bad = unsafe {
         std::mem::transmute::<u64, &[u8]>(42)
     };
-    bad[0]; //~ ERROR constant evaluation error
-    //~^ NOTE index out of bounds: the len is 0 but the index is 0
+    bad[0]; //~ ERROR index out of bounds: the len is 0 but the index is 0
 }
index f91def30d120582de6fa0e69b15d05b2e5586690..88285dc69f3176b9e2ea6d27a1283fbf9b611af4 100644 (file)
@@ -2,6 +2,5 @@ fn main() {
     let x = &2u16;
     let x = x as *const _ as *const u32;
     // This must fail because alignment is violated
-    let _x = unsafe { *x }; //~ ERROR constant evaluation error
-    //~^ NOTE tried to access memory with alignment 2, but alignment 4 is required
+    let _x = unsafe { *x }; //~ ERROR tried to access memory with alignment 2, but alignment 4 is required
 }
index f87dab76ba30084d5de534a34c22aafb7582e5f7..7541079def2c0dc0ac8f079ed050b6840ae74998 100644 (file)
@@ -3,6 +3,5 @@ fn main() {
     let x = x as *const _ as *const *const u8;
     // This must fail because alignment is violated.  Test specifically for loading pointers, which have special code
     // in miri's memory.
-    let _x = unsafe { *x }; //~ ERROR constant evaluation error
-    //~^ NOTE tried to access memory with alignment 2, but alignment
+    let _x = unsafe { *x }; //~ ERROR tried to access memory with alignment 2, but alignment
 }
index 45016473c97528e060c20806f27c7d327ffb35e0..1b9b55c6be1f2eb73c004289e8105d6e4c2a141f 100644 (file)
@@ -2,6 +2,5 @@ fn main() {
     let x = &2u16;
     let x = x as *const _ as *const [u32; 0];
     // This must fail because alignment is violated.  Test specifically for loading ZST.
-    let _x = unsafe { *x }; //~ ERROR constant evaluation error
-    //~^ NOTE tried to access memory with alignment 2, but alignment 4 is required
+    let _x = unsafe { *x }; //~ ERROR tried to access memory with alignment 2, but alignment 4 is required
 }
index 24718bce7db96bb04147b4e13fe8a480dabcb43e..1f092936148e0bd0aefaefb0b2e0d78d13a1f40c 100644 (file)
@@ -4,7 +4,6 @@
 fn main() {
     let v: Vec<u8> = Vec::with_capacity(10);
     let undef = unsafe { *v.get_unchecked(5) };
-    let x = undef + 1; //~ ERROR: error
-    //~^ NOTE attempted to read undefined bytes
+    let x = undef + 1; //~ ERROR attempted to read undefined bytes
     panic!("this should never print: {}", x);
 }
index 4096cfb93e722cb25859cae874dc5d6396c5b7ae..8eec9737546b308a3c92d7a0b97f0821952c8552 100644 (file)
@@ -1,6 +1,5 @@
 fn main() {
     let p = 44 as *const i32;
-    let x = unsafe { *p }; //~ ERROR constant evaluation error
-    //~^ NOTE a memory access tried to interpret some bytes as a pointer
+    let x = unsafe { *p }; //~ ERROR a memory access tried to interpret some bytes as a pointer
     panic!("this should never print: {}", x);
 }
index efb2dafd36fc58e5f50df098359e0f9edab855d4..2b179dcc8a452d63740c27ae34db991a6b4a2501 100644 (file)
@@ -1,5 +1,4 @@
 fn main() {
     let x = &() as *const () as *const i32;
-    let _ = unsafe { *x }; //~ ERROR constant evaluation error
-    //~^ NOTE tried to access memory with alignment 1, but alignment 4 is required
+    let _ = unsafe { *x }; //~ ERROR tried to access memory with alignment 1, but alignment 4 is required
 }