Skip to content

Commit 757e88c

Browse files
committed
use ui_test regex capabilities
1 parent 4e9de31 commit 757e88c

Some content is hidden

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

50 files changed

+54
-53
lines changed

tests/fail/alloc/global_system_mixup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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: /deallocating .*, which is Rust heap memory, using .* heap deallocation operation/
44

55
//@normalize-stderr-test: "using [A-Za-z]+ heap deallocation operation" -> "using PLATFORM heap deallocation operation"
66
//@normalize-stderr-test: "\| +\^+" -> "| ^"

tests/fail/alloc/stack_free.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Validation/SB changes why we fail
22
//@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: /deallocating .*, which is stack variable memory, using Rust heap deallocation operation/
55

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

tests/fail/provenance/ptr_int_unexposed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ fn main() {
88
let x_usize: usize = x_ptr.addr();
99
// Cast back an address that did *not* get exposed.
1010
let ptr = std::ptr::from_exposed_addr::<i32>(x_usize);
11-
assert_eq!(unsafe { *ptr }, 3); //~ ERROR: Undefined Behavior: dereferencing pointer failed
11+
assert_eq!(unsafe { *ptr }, 3); //~ ERROR: is a dangling pointer
1212
}

tests/fail/stacked_borrows/alias_through_mutation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ fn main() {
1111
retarget(&mut target_alias, target);
1212
// now `target_alias` points to the same thing as `target`
1313
*target = 13;
14-
let _val = *target_alias; //~ ERROR: borrow stack
14+
let _val = *target_alias; //~ ERROR: /read access .* tag does not exist in the borrow stack/
1515
}

tests/fail/stacked_borrows/box_exclusive_violation1.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
fn demo_mut_advanced_unique(mut our: Box<i32>) -> i32 {
1+
fn demo_box_advanced_unique(mut our: Box<i32>) -> i32 {
22
unknown_code_1(&*our);
33

44
// This "re-asserts" uniqueness of the reference: After writing, we know
@@ -24,10 +24,10 @@ fn unknown_code_1(x: &i32) {
2424

2525
fn unknown_code_2() {
2626
unsafe {
27-
*LEAK = 7; //~ ERROR: borrow stack
27+
*LEAK = 7; //~ ERROR: /write access .* tag does not exist in the borrow stack/
2828
}
2929
}
3030

3131
fn main() {
32-
demo_mut_advanced_unique(Box::new(0));
32+
demo_box_advanced_unique(Box::new(0));
3333
}

tests/fail/stacked_borrows/box_exclusive_violation1.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ LL | *our = 5;
2121
| ^^^^^^^^
2222
= note: backtrace:
2323
= note: inside `unknown_code_2` at $DIR/box_exclusive_violation1.rs:LL:CC
24-
note: inside `demo_mut_advanced_unique` at $DIR/box_exclusive_violation1.rs:LL:CC
24+
note: inside `demo_box_advanced_unique` at $DIR/box_exclusive_violation1.rs:LL:CC
2525
--> $DIR/box_exclusive_violation1.rs:LL:CC
2626
|
2727
LL | unknown_code_2();
2828
| ^^^^^^^^^^^^^^^^
2929
note: inside `main` at $DIR/box_exclusive_violation1.rs:LL:CC
3030
--> $DIR/box_exclusive_violation1.rs:LL:CC
3131
|
32-
LL | demo_mut_advanced_unique(Box::new(0));
32+
LL | demo_box_advanced_unique(Box::new(0));
3333
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3434

3535
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

tests/fail/stacked_borrows/buggy_as_mut_slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ fn main() {
1111
let v1 = safe::as_mut_slice(&v);
1212
let _v2 = safe::as_mut_slice(&v);
1313
v1[1] = 5;
14-
//~^ ERROR: borrow stack
14+
//~^ ERROR: /write access .* tag does not exist in the borrow stack/
1515
}

tests/fail/stacked_borrows/buggy_split_at_mut.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ mod safe {
1919
fn main() {
2020
let mut array = [1, 2, 3, 4];
2121
let (a, b) = safe::split_at_mut(&mut array, 0);
22-
//~^ ERROR: borrow stack
22+
//~^ ERROR: /reborrow .* tag does not exist in the borrow stack/
2323
a[1] = 5;
2424
b[1] = 6;
2525
}

tests/fail/stacked_borrows/exposed_only_ro.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ fn main() {
88
let _fool = &mut x as *mut i32; // this would have fooled the old untagged pointer logic
99
let addr = (&x as *const i32).expose_addr();
1010
let ptr = std::ptr::from_exposed_addr_mut::<i32>(addr);
11-
unsafe { *ptr = 0 }; //~ ERROR: borrow stack
11+
unsafe { *ptr = 0 }; //~ ERROR: /write access using <wildcard> .* no exposed tags have suitable permission in the borrow stack/
1212
}

tests/fail/stacked_borrows/illegal_read1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn main() {
88
let xref = unsafe { &mut *xraw }; // derived from raw, so using raw is still ok...
99
callee(xraw);
1010
let _val = *xref; // ...but any use of raw will invalidate our ref.
11-
//~^ ERROR: borrow stack
11+
//~^ ERROR: /read access .* tag does not exist in the borrow stack/
1212
}
1313

1414
fn callee(xraw: *mut i32) {

0 commit comments

Comments
 (0)