From: Ralf Jung Date: Sun, 12 Apr 2020 09:40:53 +0000 (+0200) Subject: move error-pattern to inline annotation where possible X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=30d07c861620c4c03226a9a0c693691b2e44ca58;p=rust.git move error-pattern to inline annotation where possible --- diff --git a/tests/compile-fail/intrinsics/copy_overlapping.rs b/tests/compile-fail/intrinsics/copy_overlapping.rs index 76e1e20d217..8d3c6813931 100644 --- a/tests/compile-fail/intrinsics/copy_overlapping.rs +++ b/tests/compile-fail/intrinsics/copy_overlapping.rs @@ -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 } } diff --git a/tests/compile-fail/intrinsics/copy_unaligned.rs b/tests/compile-fail/intrinsics/copy_unaligned.rs index a2a47622391..84f4de93461 100644 --- a/tests/compile-fail/intrinsics/copy_unaligned.rs +++ b/tests/compile-fail/intrinsics/copy_unaligned.rs @@ -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 }