Skip to content

Commit 465771f

Browse files
committed
Auto merge of #112681 - GuillaumeGomez:rollup-rwn4086, r=GuillaumeGomez
Rollup of 8 pull requests Successful merges: - #112403 (Prevent `.eh_frame` from being emitted for `-C panic=abort`) - #112517 (`suspicious_double_ref_op`: don't lint on `.borrow()`) - #112529 (Extend `unused_must_use` to cover block exprs) - #112614 (tweak suggestion for argument-position `impl ?Sized`) - #112654 (normalize closure output in equate_inputs_and_outputs) - #112660 (Migrate GUI colors test to original CSS color format) - #112664 (Add support for test tmpdir to fuchsia test runner) - #112669 (Fix comment for ptr alignment checks in codegen) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 0651225 + 5f152e0 commit 465771f

6 files changed

+9
-9
lines changed

tests/fail/dangling_pointers/storage_dead_dangling.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn fill(v: &mut i32) {
1010
}
1111

1212
fn evil() {
13-
unsafe { &mut *(LEAK as *mut i32) }; //~ ERROR: is a dangling pointer
13+
let _ = unsafe { &mut *(LEAK as *mut i32) }; //~ ERROR: is a dangling pointer
1414
}
1515

1616
fn main() {

tests/fail/dangling_pointers/storage_dead_dangling.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: Undefined Behavior: dereferencing pointer failed: $HEX[noalloc] is a dangling pointer (it has no provenance)
22
--> $DIR/storage_dead_dangling.rs:LL:CC
33
|
4-
LL | unsafe { &mut *(LEAK as *mut i32) };
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: $HEX[noalloc] is a dangling pointer (it has no provenance)
4+
LL | let _ = unsafe { &mut *(LEAK as *mut i32) };
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: $HEX[noalloc] is a dangling pointer (it has no provenance)
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information

tests/fail/intrinsics/uninit_uninhabited_type.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
#[allow(deprecated, invalid_value)]
44
fn main() {
5-
unsafe { std::mem::uninitialized::<!>() };
5+
let _ = unsafe { std::mem::uninitialized::<!>() };
66
//~^ ERROR: attempted to instantiate uninhabited type `!`
77
}

tests/fail/intrinsics/uninit_uninhabited_type.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: abnormal termination: aborted execution: attempted to instantiate uninhabited type `!`
22
--> $DIR/uninit_uninhabited_type.rs:LL:CC
33
|
4-
LL | unsafe { std::mem::uninitialized::<!>() };
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to instantiate uninhabited type `!`
4+
LL | let _ = unsafe { std::mem::uninitialized::<!>() };
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to instantiate uninhabited type `!`
66
|
77
= note: inside `main` at $DIR/uninit_uninhabited_type.rs:LL:CC
88

tests/fail/intrinsics/zero_fn_ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[allow(deprecated, invalid_value)]
22
fn main() {
3-
unsafe { std::mem::zeroed::<fn()>() };
3+
let _ = unsafe { std::mem::zeroed::<fn()>() };
44
//~^ ERROR: attempted to zero-initialize type `fn()`, which is invalid
55
}

tests/fail/intrinsics/zero_fn_ptr.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: abnormal termination: aborted execution: attempted to zero-initialize type `fn()`, which is invalid
22
--> $DIR/zero_fn_ptr.rs:LL:CC
33
|
4-
LL | unsafe { std::mem::zeroed::<fn()>() };
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to zero-initialize type `fn()`, which is invalid
4+
LL | let _ = unsafe { std::mem::zeroed::<fn()>() };
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to zero-initialize type `fn()`, which is invalid
66
|
77
= note: inside `main` at $DIR/zero_fn_ptr.rs:LL:CC
88

0 commit comments

Comments
 (0)