]> git.lizzy.rs Git - rust.git/commitdiff
move error-pattern to inline annotation where possible
authorRalf Jung <post@ralfj.de>
Sun, 12 Apr 2020 09:40:53 +0000 (11:40 +0200)
committerRalf Jung <post@ralfj.de>
Sun, 12 Apr 2020 10:01:20 +0000 (12:01 +0200)
tests/compile-fail/intrinsics/copy_overlapping.rs
tests/compile-fail/intrinsics/copy_unaligned.rs

index 76e1e20d2177fba97529d4f467fe8dd8cab3146f..8d3c68139317e2ea50641ab29cca732c634e0262 100644 (file)
@@ -1,4 +1,3 @@
-//error-pattern: copy_nonoverlapping called on overlapping ranges
 #![feature(intrinsics)]
 
 // Directly call intrinsic to avoid debug assertions in libstd
@@ -11,6 +10,6 @@ fn main() {
     unsafe {
         let a = data.as_mut_ptr();
         let b = a.wrapping_offset(1) as *mut _;
-        copy_nonoverlapping(a, b, 2);
+        copy_nonoverlapping(a, b, 2); //~ ERROR copy_nonoverlapping called on overlapping ranges
     }
 }
index a2a4762239184269de30e48a55ff00e936fb7274..84f4de93461e7aec452e0edb7f07e2be7313b3c4 100644 (file)
@@ -1,4 +1,3 @@
-//error-pattern: accessing memory with alignment 1, but alignment 2 is required
 #![feature(intrinsics)]
 
 // Directly call intrinsic to avoid debug assertions in libstd
@@ -10,5 +9,5 @@ fn main() {
     let mut data = [0u16; 8];
     let ptr = (&mut data[0] as *mut u16 as *mut u8).wrapping_add(1) as *mut u16;
     // Even copying 0 elements to something unaligned should error
-    unsafe { copy_nonoverlapping(&data[5], ptr, 0); }
+    unsafe { copy_nonoverlapping(&data[5], ptr, 0); } //~ ERROR accessing memory with alignment 1, but alignment 2 is required
 }