diff --git a/tests/fail/function_calls/arg_inplace_mutate.rs b/tests/fail/function_calls/arg_inplace_mutate.rs index 625a8bda8a..d47af50d40 100644 --- a/tests/fail/function_calls/arg_inplace_mutate.rs +++ b/tests/fail/function_calls/arg_inplace_mutate.rs @@ -8,13 +8,13 @@ pub struct S(i32); #[custom_mir(dialect = "runtime", phase = "optimized")] fn main() { mir! { - let unit: (); + let _unit: (); { let non_copy = S(42); let ptr = std::ptr::addr_of_mut!(non_copy); // Inside `callee`, the first argument and `*ptr` are basically // aliasing places! - Call(unit, after_call, callee(Move(*ptr), ptr)) + Call(_unit = callee(Move(*ptr), ptr), after_call) } after_call = { Return() diff --git a/tests/fail/function_calls/arg_inplace_mutate.stack.stderr b/tests/fail/function_calls/arg_inplace_mutate.stack.stderr index 471dc1dd6d..381442e69b 100644 --- a/tests/fail/function_calls/arg_inplace_mutate.stack.stderr +++ b/tests/fail/function_calls/arg_inplace_mutate.stack.stderr @@ -10,7 +10,7 @@ help: was created by a SharedReadWrite retag at offsets [0x0..0x4] --> $DIR/arg_inplace_mutate.rs:LL:CC | LL | / mir! { -LL | | let unit: (); +LL | | let _unit: (); LL | | { LL | | let non_copy = S(42); ... | @@ -27,8 +27,8 @@ LL | unsafe { ptr.write(S(0)) }; note: inside `main` --> $DIR/arg_inplace_mutate.rs:LL:CC | -LL | Call(unit, after_call, callee(Move(*ptr), ptr)) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | Call(_unit = callee(Move(*ptr), ptr), after_call) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/tests/fail/function_calls/arg_inplace_mutate.tree.stderr b/tests/fail/function_calls/arg_inplace_mutate.tree.stderr index 8393b80f25..544cd575ad 100644 --- a/tests/fail/function_calls/arg_inplace_mutate.tree.stderr +++ b/tests/fail/function_calls/arg_inplace_mutate.tree.stderr @@ -12,7 +12,7 @@ help: the accessed tag was created here --> $DIR/arg_inplace_mutate.rs:LL:CC | LL | / mir! { -LL | | let unit: (); +LL | | let _unit: (); LL | | { LL | | let non_copy = S(42); ... | @@ -29,8 +29,8 @@ LL | unsafe { ptr.write(S(0)) }; note: inside `main` --> $DIR/arg_inplace_mutate.rs:LL:CC | -LL | Call(unit, after_call, callee(Move(*ptr), ptr)) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | Call(_unit = callee(Move(*ptr), ptr), after_call) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/tests/fail/function_calls/arg_inplace_observe_after.rs b/tests/fail/function_calls/arg_inplace_observe_after.rs index 093b55759f..ea773048dd 100644 --- a/tests/fail/function_calls/arg_inplace_observe_after.rs +++ b/tests/fail/function_calls/arg_inplace_observe_after.rs @@ -6,12 +6,12 @@ pub struct S(i32); #[custom_mir(dialect = "runtime", phase = "optimized")] fn main() { mir! { - let unit: (); + let _unit: (); let _observe: i32; { let non_copy = S(42); // This could change `non_copy` in-place - Call(unit, after_call, change_arg(Move(non_copy))) + Call(_unit = change_arg(Move(non_copy)), after_call) } after_call = { // So now we must not be allowed to observe non-copy again. diff --git a/tests/fail/function_calls/arg_inplace_observe_during.none.stderr b/tests/fail/function_calls/arg_inplace_observe_during.none.stderr index baa9148479..cba23c21d1 100644 --- a/tests/fail/function_calls/arg_inplace_observe_during.none.stderr +++ b/tests/fail/function_calls/arg_inplace_observe_during.none.stderr @@ -11,8 +11,8 @@ LL | unsafe { ptr.read() }; note: inside `main` --> $DIR/arg_inplace_observe_during.rs:LL:CC | -LL | Call(unit, after_call, change_arg(Move(*ptr), ptr)) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | Call(_unit = change_arg(Move(*ptr), ptr), after_call) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/tests/fail/function_calls/arg_inplace_observe_during.rs b/tests/fail/function_calls/arg_inplace_observe_during.rs index 2e57872db9..8c6a7df7a6 100644 --- a/tests/fail/function_calls/arg_inplace_observe_during.rs +++ b/tests/fail/function_calls/arg_inplace_observe_during.rs @@ -9,12 +9,12 @@ pub struct S(i32); #[custom_mir(dialect = "runtime", phase = "optimized")] fn main() { mir! { - let unit: (); + let _unit: (); { let non_copy = S(42); let ptr = std::ptr::addr_of_mut!(non_copy); // This could change `non_copy` in-place - Call(unit, after_call, change_arg(Move(*ptr), ptr)) + Call(_unit = change_arg(Move(*ptr), ptr), after_call) } after_call = { Return() diff --git a/tests/fail/function_calls/arg_inplace_observe_during.stack.stderr b/tests/fail/function_calls/arg_inplace_observe_during.stack.stderr index a842d3a804..f8532186be 100644 --- a/tests/fail/function_calls/arg_inplace_observe_during.stack.stderr +++ b/tests/fail/function_calls/arg_inplace_observe_during.stack.stderr @@ -10,7 +10,7 @@ help: was created by a SharedReadWrite retag at offsets [0x0..0x4] --> $DIR/arg_inplace_observe_during.rs:LL:CC | LL | / mir! { -LL | | let unit: (); +LL | | let _unit: (); LL | | { LL | | let non_copy = S(42); ... | @@ -27,8 +27,8 @@ LL | x.0 = 0; note: inside `main` --> $DIR/arg_inplace_observe_during.rs:LL:CC | -LL | Call(unit, after_call, change_arg(Move(*ptr), ptr)) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | Call(_unit = change_arg(Move(*ptr), ptr), after_call) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr b/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr index 5af4856bbe..c33645bdd2 100644 --- a/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr +++ b/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr @@ -12,7 +12,7 @@ help: the accessed tag was created here --> $DIR/arg_inplace_observe_during.rs:LL:CC | LL | / mir! { -LL | | let unit: (); +LL | | let _unit: (); LL | | { LL | | let non_copy = S(42); ... | @@ -29,8 +29,8 @@ LL | x.0 = 0; note: inside `main` --> $DIR/arg_inplace_observe_during.rs:LL:CC | -LL | Call(unit, after_call, change_arg(Move(*ptr), ptr)) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | Call(_unit = change_arg(Move(*ptr), ptr), after_call) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/tests/fail/function_calls/return_pointer_aliasing.none.stderr b/tests/fail/function_calls/return_pointer_aliasing.none.stderr index 9d9dfc89f8..0a31adabf7 100644 --- a/tests/fail/function_calls/return_pointer_aliasing.none.stderr +++ b/tests/fail/function_calls/return_pointer_aliasing.none.stderr @@ -11,8 +11,8 @@ LL | unsafe { ptr.read() }; note: inside `main` --> $DIR/return_pointer_aliasing.rs:LL:CC | -LL | Call(*ptr, after_call, myfun(ptr)) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | Call(*ptr = myfun(ptr), after_call) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/tests/fail/function_calls/return_pointer_aliasing.rs b/tests/fail/function_calls/return_pointer_aliasing.rs index 829809102f..3d560af3d5 100644 --- a/tests/fail/function_calls/return_pointer_aliasing.rs +++ b/tests/fail/function_calls/return_pointer_aliasing.rs @@ -15,7 +15,7 @@ pub fn main() { let ptr = &raw mut x; // We arrange for `myfun` to have a pointer that aliases // its return place. Even just reading from that pointer is UB. - Call(*ptr, after_call, myfun(ptr)) + Call(*ptr = myfun(ptr), after_call) } after_call = { diff --git a/tests/fail/function_calls/return_pointer_aliasing.stack.stderr b/tests/fail/function_calls/return_pointer_aliasing.stack.stderr index d486dcb95d..875cc5edad 100644 --- a/tests/fail/function_calls/return_pointer_aliasing.stack.stderr +++ b/tests/fail/function_calls/return_pointer_aliasing.stack.stderr @@ -27,8 +27,8 @@ LL | unsafe { ptr.read() }; note: inside `main` --> $DIR/return_pointer_aliasing.rs:LL:CC | -LL | Call(*ptr, after_call, myfun(ptr)) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | Call(*ptr = myfun(ptr), after_call) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/tests/fail/function_calls/return_pointer_aliasing.tree.stderr b/tests/fail/function_calls/return_pointer_aliasing.tree.stderr index c491a904a1..66c2fb8db1 100644 --- a/tests/fail/function_calls/return_pointer_aliasing.tree.stderr +++ b/tests/fail/function_calls/return_pointer_aliasing.tree.stderr @@ -29,8 +29,8 @@ LL | unsafe { ptr.read() }; note: inside `main` --> $DIR/return_pointer_aliasing.rs:LL:CC | -LL | Call(*ptr, after_call, myfun(ptr)) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | Call(*ptr = myfun(ptr), after_call) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/tests/fail/function_calls/return_pointer_aliasing2.rs b/tests/fail/function_calls/return_pointer_aliasing2.rs index 7e9a632002..9d53faccd1 100644 --- a/tests/fail/function_calls/return_pointer_aliasing2.rs +++ b/tests/fail/function_calls/return_pointer_aliasing2.rs @@ -9,11 +9,11 @@ use std::intrinsics::mir::*; pub fn main() { mir! { { - let x = 0; - let ptr = &raw mut x; + let _x = 0; + let ptr = &raw mut _x; // We arrange for `myfun` to have a pointer that aliases // its return place. Even just reading from that pointer is UB. - Call(x, after_call, myfun(ptr)) + Call(_x = myfun(ptr), after_call) } after_call = { diff --git a/tests/fail/function_calls/return_pointer_aliasing2.stderr b/tests/fail/function_calls/return_pointer_aliasing2.stderr index 33a8a4b46b..443ee8643f 100644 --- a/tests/fail/function_calls/return_pointer_aliasing2.stderr +++ b/tests/fail/function_calls/return_pointer_aliasing2.stderr @@ -13,8 +13,8 @@ help: the accessed tag was created here | LL | / mir! { LL | | { -LL | | let x = 0; -LL | | let ptr = &raw mut x; +LL | | let _x = 0; +LL | | let ptr = &raw mut _x; ... | LL | | } LL | | } @@ -29,8 +29,8 @@ LL | unsafe { ptr.write(0) }; note: inside `main` --> $DIR/return_pointer_aliasing2.rs:LL:CC | -LL | Call(x, after_call, myfun(ptr)) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | Call(_x = myfun(ptr), after_call) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `::core::intrinsics::mir::__internal_remove_let` which comes from the expansion of the macro `mir` (in Nightly builds, run with -Z macro-backtrace for more info) note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace diff --git a/tests/pass/function_calls/return_place_on_heap.rs b/tests/pass/function_calls/return_place_on_heap.rs index dcfebd0f82..d410a875b1 100644 --- a/tests/pass/function_calls/return_place_on_heap.rs +++ b/tests/pass/function_calls/return_place_on_heap.rs @@ -11,7 +11,7 @@ pub fn main() { { let x = 0; let ptr = &raw mut x; - Call(*ptr, after_call, myfun()) + Call(*ptr = myfun(), after_call) } after_call = {