Skip to content

Commit 389915e

Browse files
committed
Replace all //error-pattern comments with strict syntax and fix other comments in the same files
1 parent 4bd4838 commit 389915e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+94
-90
lines changed

tests/fail/alloc/deallocate-bad-alignment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::alloc::{alloc, dealloc, Layout};
22

3-
// error-pattern: has size 1 and alignment 1, but gave size 1 and alignment 2
3+
//@error-pattern: has size 1 and alignment 1, but gave size 1 and alignment 2
44

55
fn main() {
66
unsafe {

tests/fail/alloc/deallocate-bad-size.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::alloc::{alloc, dealloc, Layout};
22

3-
// error-pattern: has size 1 and alignment 1, but gave size 2 and alignment 1
3+
//@error-pattern: has size 1 and alignment 1, but gave size 2 and alignment 1
44

55
fn main() {
66
unsafe {

tests/fail/alloc/deallocate-twice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::alloc::{alloc, dealloc, Layout};
22

3-
// error-pattern: dereferenced after this allocation got freed
3+
//@error-pattern: dereferenced after this allocation got freed
44

55
fn main() {
66
unsafe {

tests/fail/alloc/global_system_mixup.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Make sure we detect when the `Global` and `System` allocators are mixed
22
// (even when the default `Global` uses `System`).
3-
// error-pattern: which is Rust heap memory, using
3+
//@error-pattern: which is Rust heap memory, using
44

5-
// normalize-stderr-test: "using [A-Za-z]+ heap deallocation operation" -> "using PLATFORM heap deallocation operation"
6-
// normalize-stderr-test: "\| +\^+" -> "| ^"
7-
// normalize-stderr-test: "libc::free\([^()]*\)|unsafe \{ HeapFree\([^()]*\) \};" -> "FREE();"
5+
//@normalize-stderr-test: "using [A-Za-z]+ heap deallocation operation" -> "using PLATFORM heap deallocation operation"
6+
//@normalize-stderr-test: "\| +\^+" -> "| ^"
7+
//@normalize-stderr-test: "libc::free\([^()]*\)|unsafe \{ HeapFree\([^()]*\) \};" -> "FREE();"
88

99
#![feature(allocator_api, slice_ptr_get)]
1010

tests/fail/alloc/reallocate-bad-size.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::alloc::{alloc, realloc, Layout};
22

3-
// error-pattern: has size 1 and alignment 1, but gave size 2 and alignment 1
3+
//@error-pattern: has size 1 and alignment 1, but gave size 2 and alignment 1
44

55
fn main() {
66
unsafe {

tests/fail/alloc/reallocate-dangling.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::alloc::{alloc, dealloc, realloc, Layout};
22

3-
// error-pattern: dereferenced after this allocation got freed
3+
//@error-pattern: dereferenced after this allocation got freed
44

55
fn main() {
66
unsafe {

tests/fail/alloc/stack_free.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Validation/SB changes why we fail
2-
// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
2+
//@compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
33

4-
// error-pattern: which is stack variable memory, using Rust heap deallocation operation
4+
//@error-pattern: which is stack variable memory, using Rust heap deallocation operation
55

66
fn main() {
77
let x = 42;

tests/fail/concurrency/libc_pthread_create_main_terminate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// ignore-windows: No libc on Windows
2-
// error-pattern: the main thread terminated without waiting for all remaining threads
1+
//@ignore-windows: No libc on Windows
2+
//@error-pattern: the main thread terminated without waiting for all remaining threads
33

44
// Check that we terminate the program when the main thread terminates.
55

tests/fail/concurrency/thread-spawn.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
// only-windows: Only Windows is not supported.
1+
//@only-windows: Only Windows is not supported.
22

33
use std::thread;
44

5-
// error-pattern: can't create threads on Windows
5+
//@error-pattern: can't create threads on Windows
66

77
fn main() {
88
thread::spawn(|| {});

tests/fail/dangling_pointers/null_pointer_write_zst.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Some optimizations remove ZST accesses, thus masking this UB.
2-
// compile-flags: -Zmir-opt-level=0
3-
// error-pattern: memory access failed: null pointer is a dangling pointer
2+
//@compile-flags: -Zmir-opt-level=0
3+
//@error-pattern: memory access failed: null pointer is a dangling pointer
44

55
#[allow(deref_nullptr)]
66
fn main() {

0 commit comments

Comments
 (0)