Skip to content

Commit 1a3292d

Browse files
committed
Auto merge of #115018 - matthiaskrgr:rollup-pxj0qdb, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - #114834 (Avoid side-effects from `try_coerce` when suggesting borrowing LHS of cast) - #114968 (Fix UB in `std::sys::os::getenv()`) - #114976 (Ignore unexpected incr-comp session dirs) - #114999 (Migrate GUI colors test to original CSS color format) - #115000 (custom_mir: change Call() terminator syntax to something more readable) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 8af98af + 2493f1b commit 1a3292d

15 files changed

+35
-35
lines changed

tests/fail/function_calls/arg_inplace_mutate.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ pub struct S(i32);
88
#[custom_mir(dialect = "runtime", phase = "optimized")]
99
fn main() {
1010
mir! {
11-
let unit: ();
11+
let _unit: ();
1212
{
1313
let non_copy = S(42);
1414
let ptr = std::ptr::addr_of_mut!(non_copy);
1515
// Inside `callee`, the first argument and `*ptr` are basically
1616
// aliasing places!
17-
Call(unit, after_call, callee(Move(*ptr), ptr))
17+
Call(_unit = callee(Move(*ptr), ptr), after_call)
1818
}
1919
after_call = {
2020
Return()

tests/fail/function_calls/arg_inplace_mutate.stack.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x4]
1010
--> $DIR/arg_inplace_mutate.rs:LL:CC
1111
|
1212
LL | / mir! {
13-
LL | | let unit: ();
13+
LL | | let _unit: ();
1414
LL | | {
1515
LL | | let non_copy = S(42);
1616
... |
@@ -27,8 +27,8 @@ LL | unsafe { ptr.write(S(0)) };
2727
note: inside `main`
2828
--> $DIR/arg_inplace_mutate.rs:LL:CC
2929
|
30-
LL | Call(unit, after_call, callee(Move(*ptr), ptr))
31-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30+
LL | Call(_unit = callee(Move(*ptr), ptr), after_call)
31+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3232
= 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)
3333

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

tests/fail/function_calls/arg_inplace_mutate.tree.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ help: the accessed tag <TAG> was created here
1212
--> $DIR/arg_inplace_mutate.rs:LL:CC
1313
|
1414
LL | / mir! {
15-
LL | | let unit: ();
15+
LL | | let _unit: ();
1616
LL | | {
1717
LL | | let non_copy = S(42);
1818
... |
@@ -29,8 +29,8 @@ LL | unsafe { ptr.write(S(0)) };
2929
note: inside `main`
3030
--> $DIR/arg_inplace_mutate.rs:LL:CC
3131
|
32-
LL | Call(unit, after_call, callee(Move(*ptr), ptr))
33-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32+
LL | Call(_unit = callee(Move(*ptr), ptr), after_call)
33+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3434
= 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)
3535

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

tests/fail/function_calls/arg_inplace_observe_after.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ pub struct S(i32);
66
#[custom_mir(dialect = "runtime", phase = "optimized")]
77
fn main() {
88
mir! {
9-
let unit: ();
9+
let _unit: ();
1010
let _observe: i32;
1111
{
1212
let non_copy = S(42);
1313
// This could change `non_copy` in-place
14-
Call(unit, after_call, change_arg(Move(non_copy)))
14+
Call(_unit = change_arg(Move(non_copy)), after_call)
1515
}
1616
after_call = {
1717
// So now we must not be allowed to observe non-copy again.

tests/fail/function_calls/arg_inplace_observe_during.none.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ LL | unsafe { ptr.read() };
1111
note: inside `main`
1212
--> $DIR/arg_inplace_observe_during.rs:LL:CC
1313
|
14-
LL | Call(unit, after_call, change_arg(Move(*ptr), ptr))
15-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14+
LL | Call(_unit = change_arg(Move(*ptr), ptr), after_call)
15+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1616

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

tests/fail/function_calls/arg_inplace_observe_during.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ pub struct S(i32);
99
#[custom_mir(dialect = "runtime", phase = "optimized")]
1010
fn main() {
1111
mir! {
12-
let unit: ();
12+
let _unit: ();
1313
{
1414
let non_copy = S(42);
1515
let ptr = std::ptr::addr_of_mut!(non_copy);
1616
// This could change `non_copy` in-place
17-
Call(unit, after_call, change_arg(Move(*ptr), ptr))
17+
Call(_unit = change_arg(Move(*ptr), ptr), after_call)
1818
}
1919
after_call = {
2020
Return()

tests/fail/function_calls/arg_inplace_observe_during.stack.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x4]
1010
--> $DIR/arg_inplace_observe_during.rs:LL:CC
1111
|
1212
LL | / mir! {
13-
LL | | let unit: ();
13+
LL | | let _unit: ();
1414
LL | | {
1515
LL | | let non_copy = S(42);
1616
... |
@@ -27,8 +27,8 @@ LL | x.0 = 0;
2727
note: inside `main`
2828
--> $DIR/arg_inplace_observe_during.rs:LL:CC
2929
|
30-
LL | Call(unit, after_call, change_arg(Move(*ptr), ptr))
31-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30+
LL | Call(_unit = change_arg(Move(*ptr), ptr), after_call)
31+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3232
= 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)
3333

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

tests/fail/function_calls/arg_inplace_observe_during.tree.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ help: the accessed tag <TAG> was created here
1212
--> $DIR/arg_inplace_observe_during.rs:LL:CC
1313
|
1414
LL | / mir! {
15-
LL | | let unit: ();
15+
LL | | let _unit: ();
1616
LL | | {
1717
LL | | let non_copy = S(42);
1818
... |
@@ -29,8 +29,8 @@ LL | x.0 = 0;
2929
note: inside `main`
3030
--> $DIR/arg_inplace_observe_during.rs:LL:CC
3131
|
32-
LL | Call(unit, after_call, change_arg(Move(*ptr), ptr))
33-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32+
LL | Call(_unit = change_arg(Move(*ptr), ptr), after_call)
33+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3434
= 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)
3535

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

tests/fail/function_calls/return_pointer_aliasing.none.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ LL | unsafe { ptr.read() };
1111
note: inside `main`
1212
--> $DIR/return_pointer_aliasing.rs:LL:CC
1313
|
14-
LL | Call(*ptr, after_call, myfun(ptr))
15-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14+
LL | Call(*ptr = myfun(ptr), after_call)
15+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1616

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

tests/fail/function_calls/return_pointer_aliasing.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub fn main() {
1515
let ptr = &raw mut x;
1616
// We arrange for `myfun` to have a pointer that aliases
1717
// its return place. Even just reading from that pointer is UB.
18-
Call(*ptr, after_call, myfun(ptr))
18+
Call(*ptr = myfun(ptr), after_call)
1919
}
2020

2121
after_call = {

tests/fail/function_calls/return_pointer_aliasing.stack.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ LL | unsafe { ptr.read() };
2727
note: inside `main`
2828
--> $DIR/return_pointer_aliasing.rs:LL:CC
2929
|
30-
LL | Call(*ptr, after_call, myfun(ptr))
31-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30+
LL | Call(*ptr = myfun(ptr), after_call)
31+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3232
= 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)
3333

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

tests/fail/function_calls/return_pointer_aliasing.tree.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ LL | unsafe { ptr.read() };
2929
note: inside `main`
3030
--> $DIR/return_pointer_aliasing.rs:LL:CC
3131
|
32-
LL | Call(*ptr, after_call, myfun(ptr))
33-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32+
LL | Call(*ptr = myfun(ptr), after_call)
33+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3434
= 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)
3535

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

tests/fail/function_calls/return_pointer_aliasing2.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ use std::intrinsics::mir::*;
99
pub fn main() {
1010
mir! {
1111
{
12-
let x = 0;
13-
let ptr = &raw mut x;
12+
let _x = 0;
13+
let ptr = &raw mut _x;
1414
// We arrange for `myfun` to have a pointer that aliases
1515
// its return place. Even just reading from that pointer is UB.
16-
Call(x, after_call, myfun(ptr))
16+
Call(_x = myfun(ptr), after_call)
1717
}
1818

1919
after_call = {

tests/fail/function_calls/return_pointer_aliasing2.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ help: the accessed tag <TAG> was created here
1313
|
1414
LL | / mir! {
1515
LL | | {
16-
LL | | let x = 0;
17-
LL | | let ptr = &raw mut x;
16+
LL | | let _x = 0;
17+
LL | | let ptr = &raw mut _x;
1818
... |
1919
LL | | }
2020
LL | | }
@@ -29,8 +29,8 @@ LL | unsafe { ptr.write(0) };
2929
note: inside `main`
3030
--> $DIR/return_pointer_aliasing2.rs:LL:CC
3131
|
32-
LL | Call(x, after_call, myfun(ptr))
33-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32+
LL | Call(_x = myfun(ptr), after_call)
33+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3434
= 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)
3535

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

tests/pass/function_calls/return_place_on_heap.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn main() {
1111
{
1212
let x = 0;
1313
let ptr = &raw mut x;
14-
Call(*ptr, after_call, myfun())
14+
Call(*ptr = myfun(), after_call)
1515
}
1616

1717
after_call = {

0 commit comments

Comments
 (0)