Skip to content

Commit 30d07c8

Browse files
committed
move error-pattern to inline annotation where possible
1 parent 78ce616 commit 30d07c8

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

tests/compile-fail/intrinsics/copy_overlapping.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//error-pattern: copy_nonoverlapping called on overlapping ranges
21
#![feature(intrinsics)]
32

43
// Directly call intrinsic to avoid debug assertions in libstd
@@ -11,6 +10,6 @@ fn main() {
1110
unsafe {
1211
let a = data.as_mut_ptr();
1312
let b = a.wrapping_offset(1) as *mut _;
14-
copy_nonoverlapping(a, b, 2);
13+
copy_nonoverlapping(a, b, 2); //~ ERROR copy_nonoverlapping called on overlapping ranges
1514
}
1615
}

tests/compile-fail/intrinsics/copy_unaligned.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//error-pattern: accessing memory with alignment 1, but alignment 2 is required
21
#![feature(intrinsics)]
32

43
// Directly call intrinsic to avoid debug assertions in libstd
@@ -10,5 +9,5 @@ fn main() {
109
let mut data = [0u16; 8];
1110
let ptr = (&mut data[0] as *mut u16 as *mut u8).wrapping_add(1) as *mut u16;
1211
// Even copying 0 elements to something unaligned should error
13-
unsafe { copy_nonoverlapping(&data[5], ptr, 0); }
12+
unsafe { copy_nonoverlapping(&data[5], ptr, 0); } //~ ERROR accessing memory with alignment 1, but alignment 2 is required
1413
}

0 commit comments

Comments
 (0)