From 757e88c901f7b8fed41829729b6a23317be12b3e Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 13 Jul 2022 18:59:33 -0400 Subject: [PATCH] use ui_test regex capabilities --- tests/fail/alloc/global_system_mixup.rs | 2 +- tests/fail/alloc/stack_free.rs | 2 +- tests/fail/provenance/ptr_int_unexposed.rs | 2 +- tests/fail/stacked_borrows/alias_through_mutation.rs | 2 +- tests/fail/stacked_borrows/box_exclusive_violation1.rs | 6 +++--- tests/fail/stacked_borrows/box_exclusive_violation1.stderr | 4 ++-- tests/fail/stacked_borrows/buggy_as_mut_slice.rs | 2 +- tests/fail/stacked_borrows/buggy_split_at_mut.rs | 2 +- tests/fail/stacked_borrows/exposed_only_ro.rs | 2 +- tests/fail/stacked_borrows/illegal_read1.rs | 2 +- tests/fail/stacked_borrows/illegal_read2.rs | 2 +- tests/fail/stacked_borrows/illegal_read3.rs | 2 +- tests/fail/stacked_borrows/illegal_read4.rs | 2 +- tests/fail/stacked_borrows/illegal_read5.rs | 2 +- tests/fail/stacked_borrows/illegal_read6.rs | 2 +- tests/fail/stacked_borrows/illegal_read7.rs | 2 +- tests/fail/stacked_borrows/illegal_read8.rs | 2 +- tests/fail/stacked_borrows/illegal_read_despite_exposed1.rs | 2 +- tests/fail/stacked_borrows/illegal_read_despite_exposed2.rs | 2 +- tests/fail/stacked_borrows/illegal_write1.rs | 2 +- tests/fail/stacked_borrows/illegal_write2.rs | 2 +- tests/fail/stacked_borrows/illegal_write3.rs | 2 +- tests/fail/stacked_borrows/illegal_write4.rs | 2 +- tests/fail/stacked_borrows/illegal_write5.rs | 2 +- tests/fail/stacked_borrows/illegal_write6.rs | 2 +- .../fail/stacked_borrows/illegal_write_despite_exposed1.rs | 3 ++- tests/fail/stacked_borrows/interior_mut1.rs | 2 +- tests/fail/stacked_borrows/interior_mut2.rs | 2 +- tests/fail/stacked_borrows/load_invalid_mut.rs | 2 +- tests/fail/stacked_borrows/load_invalid_shr.rs | 2 +- tests/fail/stacked_borrows/mut_exclusive_violation1.rs | 2 +- tests/fail/stacked_borrows/mut_exclusive_violation2.rs | 2 +- tests/fail/stacked_borrows/outdated_local.rs | 2 +- tests/fail/stacked_borrows/pass_invalid_mut.rs | 2 +- tests/fail/stacked_borrows/pass_invalid_shr.rs | 2 +- tests/fail/stacked_borrows/pointer_smuggling.rs | 2 +- tests/fail/stacked_borrows/raw_tracking.rs | 2 +- tests/fail/stacked_borrows/return_invalid_mut.rs | 2 +- tests/fail/stacked_borrows/return_invalid_mut_option.rs | 2 +- tests/fail/stacked_borrows/return_invalid_mut_tuple.rs | 2 +- tests/fail/stacked_borrows/return_invalid_shr.rs | 2 +- tests/fail/stacked_borrows/return_invalid_shr_option.rs | 2 +- tests/fail/stacked_borrows/return_invalid_shr_tuple.rs | 2 +- tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.rs | 2 +- tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.rs | 2 +- tests/fail/stacked_borrows/shr_frozen_violation1.rs | 2 +- tests/fail/stacked_borrows/transmute-is-no-escape.rs | 2 +- tests/fail/stacked_borrows/unescaped_local.rs | 2 +- tests/fail/stacked_borrows/unescaped_static.rs | 2 +- tests/fail/stacked_borrows/zst_slice.rs | 2 +- 50 files changed, 54 insertions(+), 53 deletions(-) diff --git a/tests/fail/alloc/global_system_mixup.rs b/tests/fail/alloc/global_system_mixup.rs index 01db2f1a225d..47b098c71a2b 100644 --- a/tests/fail/alloc/global_system_mixup.rs +++ b/tests/fail/alloc/global_system_mixup.rs @@ -1,6 +1,6 @@ // Make sure we detect when the `Global` and `System` allocators are mixed // (even when the default `Global` uses `System`). -//@error-pattern: which is Rust heap memory, using +//@error-pattern: /deallocating .*, which is Rust heap memory, using .* heap deallocation operation/ //@normalize-stderr-test: "using [A-Za-z]+ heap deallocation operation" -> "using PLATFORM heap deallocation operation" //@normalize-stderr-test: "\| +\^+" -> "| ^" diff --git a/tests/fail/alloc/stack_free.rs b/tests/fail/alloc/stack_free.rs index a97431bc2f05..baf53decc441 100644 --- a/tests/fail/alloc/stack_free.rs +++ b/tests/fail/alloc/stack_free.rs @@ -1,7 +1,7 @@ // Validation/SB changes why we fail //@compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows -//@error-pattern: which is stack variable memory, using Rust heap deallocation operation +//@error-pattern: /deallocating .*, which is stack variable memory, using Rust heap deallocation operation/ fn main() { let x = 42; diff --git a/tests/fail/provenance/ptr_int_unexposed.rs b/tests/fail/provenance/ptr_int_unexposed.rs index dd8d52b2d2e2..07de41d10a03 100644 --- a/tests/fail/provenance/ptr_int_unexposed.rs +++ b/tests/fail/provenance/ptr_int_unexposed.rs @@ -8,5 +8,5 @@ fn main() { let x_usize: usize = x_ptr.addr(); // Cast back an address that did *not* get exposed. let ptr = std::ptr::from_exposed_addr::(x_usize); - assert_eq!(unsafe { *ptr }, 3); //~ ERROR: Undefined Behavior: dereferencing pointer failed + assert_eq!(unsafe { *ptr }, 3); //~ ERROR: is a dangling pointer } diff --git a/tests/fail/stacked_borrows/alias_through_mutation.rs b/tests/fail/stacked_borrows/alias_through_mutation.rs index dfadeec6c9e9..73095bb2fc94 100644 --- a/tests/fail/stacked_borrows/alias_through_mutation.rs +++ b/tests/fail/stacked_borrows/alias_through_mutation.rs @@ -11,5 +11,5 @@ fn main() { retarget(&mut target_alias, target); // now `target_alias` points to the same thing as `target` *target = 13; - let _val = *target_alias; //~ ERROR: borrow stack + let _val = *target_alias; //~ ERROR: /read access .* tag does not exist in the borrow stack/ } diff --git a/tests/fail/stacked_borrows/box_exclusive_violation1.rs b/tests/fail/stacked_borrows/box_exclusive_violation1.rs index ce7ff8f9e2aa..87a6b7bbd67e 100644 --- a/tests/fail/stacked_borrows/box_exclusive_violation1.rs +++ b/tests/fail/stacked_borrows/box_exclusive_violation1.rs @@ -1,4 +1,4 @@ -fn demo_mut_advanced_unique(mut our: Box) -> i32 { +fn demo_box_advanced_unique(mut our: Box) -> i32 { unknown_code_1(&*our); // This "re-asserts" uniqueness of the reference: After writing, we know @@ -24,10 +24,10 @@ fn unknown_code_1(x: &i32) { fn unknown_code_2() { unsafe { - *LEAK = 7; //~ ERROR: borrow stack + *LEAK = 7; //~ ERROR: /write access .* tag does not exist in the borrow stack/ } } fn main() { - demo_mut_advanced_unique(Box::new(0)); + demo_box_advanced_unique(Box::new(0)); } diff --git a/tests/fail/stacked_borrows/box_exclusive_violation1.stderr b/tests/fail/stacked_borrows/box_exclusive_violation1.stderr index 88ecca87962d..7214ef27be33 100644 --- a/tests/fail/stacked_borrows/box_exclusive_violation1.stderr +++ b/tests/fail/stacked_borrows/box_exclusive_violation1.stderr @@ -21,7 +21,7 @@ LL | *our = 5; | ^^^^^^^^ = note: backtrace: = note: inside `unknown_code_2` at $DIR/box_exclusive_violation1.rs:LL:CC -note: inside `demo_mut_advanced_unique` at $DIR/box_exclusive_violation1.rs:LL:CC +note: inside `demo_box_advanced_unique` at $DIR/box_exclusive_violation1.rs:LL:CC --> $DIR/box_exclusive_violation1.rs:LL:CC | LL | unknown_code_2(); @@ -29,7 +29,7 @@ LL | unknown_code_2(); note: inside `main` at $DIR/box_exclusive_violation1.rs:LL:CC --> $DIR/box_exclusive_violation1.rs:LL:CC | -LL | demo_mut_advanced_unique(Box::new(0)); +LL | demo_box_advanced_unique(Box::new(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/tests/fail/stacked_borrows/buggy_as_mut_slice.rs b/tests/fail/stacked_borrows/buggy_as_mut_slice.rs index 5eeec933c7c8..8615a9a58ad9 100644 --- a/tests/fail/stacked_borrows/buggy_as_mut_slice.rs +++ b/tests/fail/stacked_borrows/buggy_as_mut_slice.rs @@ -11,5 +11,5 @@ fn main() { let v1 = safe::as_mut_slice(&v); let _v2 = safe::as_mut_slice(&v); v1[1] = 5; - //~^ ERROR: borrow stack + //~^ ERROR: /write access .* tag does not exist in the borrow stack/ } diff --git a/tests/fail/stacked_borrows/buggy_split_at_mut.rs b/tests/fail/stacked_borrows/buggy_split_at_mut.rs index 92380a4bf496..db64d559c517 100644 --- a/tests/fail/stacked_borrows/buggy_split_at_mut.rs +++ b/tests/fail/stacked_borrows/buggy_split_at_mut.rs @@ -19,7 +19,7 @@ mod safe { fn main() { let mut array = [1, 2, 3, 4]; let (a, b) = safe::split_at_mut(&mut array, 0); - //~^ ERROR: borrow stack + //~^ ERROR: /reborrow .* tag does not exist in the borrow stack/ a[1] = 5; b[1] = 6; } diff --git a/tests/fail/stacked_borrows/exposed_only_ro.rs b/tests/fail/stacked_borrows/exposed_only_ro.rs index f2fdc213b143..0b4fb0ccd33b 100644 --- a/tests/fail/stacked_borrows/exposed_only_ro.rs +++ b/tests/fail/stacked_borrows/exposed_only_ro.rs @@ -8,5 +8,5 @@ fn main() { let _fool = &mut x as *mut i32; // this would have fooled the old untagged pointer logic let addr = (&x as *const i32).expose_addr(); let ptr = std::ptr::from_exposed_addr_mut::(addr); - unsafe { *ptr = 0 }; //~ ERROR: borrow stack + unsafe { *ptr = 0 }; //~ ERROR: /write access using .* no exposed tags have suitable permission in the borrow stack/ } diff --git a/tests/fail/stacked_borrows/illegal_read1.rs b/tests/fail/stacked_borrows/illegal_read1.rs index b5734964060e..1dea282739ce 100644 --- a/tests/fail/stacked_borrows/illegal_read1.rs +++ b/tests/fail/stacked_borrows/illegal_read1.rs @@ -8,7 +8,7 @@ fn main() { let xref = unsafe { &mut *xraw }; // derived from raw, so using raw is still ok... callee(xraw); let _val = *xref; // ...but any use of raw will invalidate our ref. - //~^ ERROR: borrow stack + //~^ ERROR: /read access .* tag does not exist in the borrow stack/ } fn callee(xraw: *mut i32) { diff --git a/tests/fail/stacked_borrows/illegal_read2.rs b/tests/fail/stacked_borrows/illegal_read2.rs index ed6972c1deb9..b765b4d9ce99 100644 --- a/tests/fail/stacked_borrows/illegal_read2.rs +++ b/tests/fail/stacked_borrows/illegal_read2.rs @@ -8,7 +8,7 @@ fn main() { let xref = unsafe { &mut *xraw }; // derived from raw, so using raw is still ok... callee(xraw); let _val = *xref; // ...but any use of raw will invalidate our ref. - //~^ ERROR: borrow stack + //~^ ERROR: /read access .* tag does not exist in the borrow stack/ } fn callee(xraw: *mut i32) { diff --git a/tests/fail/stacked_borrows/illegal_read3.rs b/tests/fail/stacked_borrows/illegal_read3.rs index 0173ca14b22d..43ea0a0e84da 100644 --- a/tests/fail/stacked_borrows/illegal_read3.rs +++ b/tests/fail/stacked_borrows/illegal_read3.rs @@ -18,7 +18,7 @@ fn main() { callee(xref1_sneaky); // ... though any use of it will invalidate our ref. let _val = *xref2; - //~^ ERROR: borrow stack + //~^ ERROR: /read access .* tag does not exist in the borrow stack/ } fn callee(xref1: HiddenRef) { diff --git a/tests/fail/stacked_borrows/illegal_read4.rs b/tests/fail/stacked_borrows/illegal_read4.rs index 2d4e395a4270..a9ecb88d3520 100644 --- a/tests/fail/stacked_borrows/illegal_read4.rs +++ b/tests/fail/stacked_borrows/illegal_read4.rs @@ -5,5 +5,5 @@ fn main() { let xraw = xref1 as *mut _; let xref2 = unsafe { &mut *xraw }; let _val = unsafe { *xraw }; // use the raw again, this invalidates xref2 *even* with the special read except for uniq refs - let _illegal = *xref2; //~ ERROR: borrow stack + let _illegal = *xref2; //~ ERROR: /read access .* tag does not exist in the borrow stack/ } diff --git a/tests/fail/stacked_borrows/illegal_read5.rs b/tests/fail/stacked_borrows/illegal_read5.rs index 49556e618d27..228c15f72e17 100644 --- a/tests/fail/stacked_borrows/illegal_read5.rs +++ b/tests/fail/stacked_borrows/illegal_read5.rs @@ -14,5 +14,5 @@ fn main() { let _val = *xref; // we can even still use our mutable reference mem::forget(unsafe { ptr::read(xshr) }); // but after reading through the shared ref let _val = *xref; // the mutable one is dead and gone - //~^ ERROR: borrow stack + //~^ ERROR: /read access .* tag does not exist in the borrow stack/ } diff --git a/tests/fail/stacked_borrows/illegal_read6.rs b/tests/fail/stacked_borrows/illegal_read6.rs index 943a61af4f6e..4af22580ab64 100644 --- a/tests/fail/stacked_borrows/illegal_read6.rs +++ b/tests/fail/stacked_borrows/illegal_read6.rs @@ -5,6 +5,6 @@ fn main() { let raw = x as *mut _; let x = &mut *x; // kill `raw` let _y = &*x; // this should not activate `raw` again - let _val = *raw; //~ ERROR: borrow stack + let _val = *raw; //~ ERROR: /read access .* tag does not exist in the borrow stack/ } } diff --git a/tests/fail/stacked_borrows/illegal_read7.rs b/tests/fail/stacked_borrows/illegal_read7.rs index e263e8b70a91..c0d3816f4475 100644 --- a/tests/fail/stacked_borrows/illegal_read7.rs +++ b/tests/fail/stacked_borrows/illegal_read7.rs @@ -17,6 +17,6 @@ fn main() { // without invalidating `x`. That would be bad! It would mean that creating `shr` // leaked `x` to `raw`. let _val = ptr::read(raw); - let _val = *x.get_mut(); //~ ERROR: borrow stack + let _val = *x.get_mut(); //~ ERROR: /reborrow .* tag does not exist in the borrow stack/ } } diff --git a/tests/fail/stacked_borrows/illegal_read8.rs b/tests/fail/stacked_borrows/illegal_read8.rs index 13c12cc75d77..f0a1658a5a23 100644 --- a/tests/fail/stacked_borrows/illegal_read8.rs +++ b/tests/fail/stacked_borrows/illegal_read8.rs @@ -10,6 +10,6 @@ fn main() { let _val = *y2; let _val = *y1; *y2 += 1; - let _fail = *y1; //~ ERROR: borrow stack + let _fail = *y1; //~ ERROR: /read access .* tag does not exist in the borrow stack/ } } diff --git a/tests/fail/stacked_borrows/illegal_read_despite_exposed1.rs b/tests/fail/stacked_borrows/illegal_read_despite_exposed1.rs index d779d4e44657..76516b7d924b 100644 --- a/tests/fail/stacked_borrows/illegal_read_despite_exposed1.rs +++ b/tests/fail/stacked_borrows/illegal_read_despite_exposed1.rs @@ -12,6 +12,6 @@ fn main() { // And we test that it has uniqueness by doing a conflicting write. *exposed_ptr = 0; // Stack: Unknown( u32 { *a = 1; let _b = &*a; - unsafe { *y = 2 }; //~ ERROR: not granting access to tag + unsafe { *y = 2 }; //~ ERROR: /not granting access .* because incompatible item .* is protected/ return *a; } diff --git a/tests/fail/stacked_borrows/illegal_write_despite_exposed1.rs b/tests/fail/stacked_borrows/illegal_write_despite_exposed1.rs index f14fcb14793c..0e34c5c98fc1 100644 --- a/tests/fail/stacked_borrows/illegal_write_despite_exposed1.rs +++ b/tests/fail/stacked_borrows/illegal_write_despite_exposed1.rs @@ -9,8 +9,9 @@ fn main() { let root2 = &*exposed_ptr; // Stack: Unknown( &mut i32 { let xraw = x as *mut (i32, i32); let ret = unsafe { &mut (*xraw).1 }; let _val = unsafe { *xraw }; // invalidate xref - ret //~ ERROR: borrow stack + ret //~ ERROR: /reborrow .* tag does not exist in the borrow stack/ } fn main() { diff --git a/tests/fail/stacked_borrows/return_invalid_mut_option.rs b/tests/fail/stacked_borrows/return_invalid_mut_option.rs index 931b420166e7..da3401260e1e 100644 --- a/tests/fail/stacked_borrows/return_invalid_mut_option.rs +++ b/tests/fail/stacked_borrows/return_invalid_mut_option.rs @@ -10,7 +10,7 @@ fn foo(x: &mut (i32, i32)) -> Option<&mut i32> { fn main() { match foo(&mut (1, 2)) { - Some(_x) => {} //~ ERROR: borrow stack + Some(_x) => {} //~ ERROR: /reborrow .* tag does not exist in the borrow stack/ None => {} } } diff --git a/tests/fail/stacked_borrows/return_invalid_mut_tuple.rs b/tests/fail/stacked_borrows/return_invalid_mut_tuple.rs index fbd9a6e5d269..2184d20b1cfa 100644 --- a/tests/fail/stacked_borrows/return_invalid_mut_tuple.rs +++ b/tests/fail/stacked_borrows/return_invalid_mut_tuple.rs @@ -8,5 +8,5 @@ fn foo(x: &mut (i32, i32)) -> (&mut i32,) { } fn main() { - foo(&mut (1, 2)).0; //~ ERROR: borrow stack + foo(&mut (1, 2)).0; //~ ERROR: /reborrow .* tag does not exist in the borrow stack/ } diff --git a/tests/fail/stacked_borrows/return_invalid_shr.rs b/tests/fail/stacked_borrows/return_invalid_shr.rs index a595b91c834c..b1d16c025ebf 100644 --- a/tests/fail/stacked_borrows/return_invalid_shr.rs +++ b/tests/fail/stacked_borrows/return_invalid_shr.rs @@ -3,7 +3,7 @@ fn foo(x: &mut (i32, i32)) -> &i32 { let xraw = x as *mut (i32, i32); let ret = unsafe { &(*xraw).1 }; unsafe { *xraw = (42, 23) }; // unfreeze - ret //~ ERROR: borrow stack + ret //~ ERROR: /reborrow .* tag does not exist in the borrow stack/ } fn main() { diff --git a/tests/fail/stacked_borrows/return_invalid_shr_option.rs b/tests/fail/stacked_borrows/return_invalid_shr_option.rs index 56af567f6e8f..e9faa945206e 100644 --- a/tests/fail/stacked_borrows/return_invalid_shr_option.rs +++ b/tests/fail/stacked_borrows/return_invalid_shr_option.rs @@ -9,7 +9,7 @@ fn foo(x: &mut (i32, i32)) -> Option<&i32> { fn main() { match foo(&mut (1, 2)) { - Some(_x) => {} //~ ERROR: borrow stack + Some(_x) => {} //~ ERROR: /reborrow .* tag does not exist in the borrow stack/ None => {} } } diff --git a/tests/fail/stacked_borrows/return_invalid_shr_tuple.rs b/tests/fail/stacked_borrows/return_invalid_shr_tuple.rs index 38f01d7cc20b..11eb4de56c9f 100644 --- a/tests/fail/stacked_borrows/return_invalid_shr_tuple.rs +++ b/tests/fail/stacked_borrows/return_invalid_shr_tuple.rs @@ -8,5 +8,5 @@ fn foo(x: &mut (i32, i32)) -> (&i32,) { } fn main() { - foo(&mut (1, 2)).0; //~ ERROR: borrow stack + foo(&mut (1, 2)).0; //~ ERROR: /reborrow .* tag does not exist in the borrow stack/ } diff --git a/tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.rs b/tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.rs index 91994d286b95..01b2775d9d36 100644 --- a/tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.rs +++ b/tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.rs @@ -11,6 +11,6 @@ fn main() { let y: &mut Cell = mem::transmute(&mut *x); // launder lifetime let shr_rw = &*x; // thanks to interior mutability this will be a SharedReadWrite shr_rw.set(1); - y.get_mut(); //~ ERROR: borrow stack + y.get_mut(); //~ ERROR: /reborrow .* tag does not exist in the borrow stack/ } } diff --git a/tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.rs b/tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.rs index ee44ebbb0718..012e9561ca84 100644 --- a/tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.rs +++ b/tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.rs @@ -12,6 +12,6 @@ fn main() { let y: &i32 = mem::transmute(&*x.borrow()); // launder lifetime let shr_rw = &*x; // thanks to interior mutability this will be a SharedReadWrite shr_rw.replace(1); - let _val = *y; //~ ERROR: borrow stack + let _val = *y; //~ ERROR: /read access .* tag does not exist in the borrow stack/ } } diff --git a/tests/fail/stacked_borrows/shr_frozen_violation1.rs b/tests/fail/stacked_borrows/shr_frozen_violation1.rs index 11082da6ea3a..d1322dc6e57b 100644 --- a/tests/fail/stacked_borrows/shr_frozen_violation1.rs +++ b/tests/fail/stacked_borrows/shr_frozen_violation1.rs @@ -10,6 +10,6 @@ fn main() { fn unknown_code(x: &i32) { unsafe { - *(x as *const i32 as *mut i32) = 7; //~ ERROR: only grants SharedReadOnly permission + *(x as *const i32 as *mut i32) = 7; //~ ERROR: /write access .* only grants SharedReadOnly permission/ } } diff --git a/tests/fail/stacked_borrows/transmute-is-no-escape.rs b/tests/fail/stacked_borrows/transmute-is-no-escape.rs index c7d609023201..233b927dfc7e 100644 --- a/tests/fail/stacked_borrows/transmute-is-no-escape.rs +++ b/tests/fail/stacked_borrows/transmute-is-no-escape.rs @@ -10,5 +10,5 @@ fn main() { let _raw: *mut i32 = unsafe { mem::transmute(&mut x[0]) }; // `raw` still carries a tag, so we get another pointer to the same location that does not carry a tag let raw = (&mut x[1] as *mut i32).wrapping_offset(-1); - unsafe { *raw = 13 }; //~ ERROR: borrow stack + unsafe { *raw = 13 }; //~ ERROR: /write access .* tag does not exist in the borrow stack/ } diff --git a/tests/fail/stacked_borrows/unescaped_local.rs b/tests/fail/stacked_borrows/unescaped_local.rs index 5b808472b4e6..49c0e66d8570 100644 --- a/tests/fail/stacked_borrows/unescaped_local.rs +++ b/tests/fail/stacked_borrows/unescaped_local.rs @@ -7,6 +7,6 @@ fn main() { let raw = &mut x as *mut i32 as usize as *mut i32; let _ptr = &mut x; unsafe { - *raw = 13; //~ ERROR: borrow stack + *raw = 13; //~ ERROR: /write access .* no exposed tags/ } } diff --git a/tests/fail/stacked_borrows/unescaped_static.rs b/tests/fail/stacked_borrows/unescaped_static.rs index 66641d648d86..a25d9b5162ec 100644 --- a/tests/fail/stacked_borrows/unescaped_static.rs +++ b/tests/fail/stacked_borrows/unescaped_static.rs @@ -3,5 +3,5 @@ static ARRAY: [u8; 2] = [0, 1]; fn main() { let ptr_to_first = &ARRAY[0] as *const u8; // Illegally use this to access the 2nd element. - let _val = unsafe { *ptr_to_first.add(1) }; //~ ERROR: borrow stack + let _val = unsafe { *ptr_to_first.add(1) }; //~ ERROR: /read access .* tag does not exist in the borrow stack/ } diff --git a/tests/fail/stacked_borrows/zst_slice.rs b/tests/fail/stacked_borrows/zst_slice.rs index 3e27f514bc88..11065186fc49 100644 --- a/tests/fail/stacked_borrows/zst_slice.rs +++ b/tests/fail/stacked_borrows/zst_slice.rs @@ -1,5 +1,5 @@ //@compile-flags: -Zmiri-strict-provenance -//@error-pattern: does not exist in the borrow stack +//@error-pattern: /reborrow .* tag does not exist in the borrow stack/ fn main() { unsafe {