Skip to content

Commit b13b79d

Browse files
committed
Auto merge of #1775 - ABouttefeux:master, r=RalfJung
Fix failing test after merge of PR rust#83948 Cc rust-lang/rust#84202
2 parents f76e256 + 64d07ea commit b13b79d

File tree

5 files changed

+5
-1
lines changed

5 files changed

+5
-1
lines changed

rust-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
481598b26db6144c580dc113f4d78b4151b5a1bc
1+
043d9160769a330df5d8a21e846785e2c89f357d

tests/compile-fail/null_pointer_deref.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[allow(deref_nullptr)]
12
fn main() {
23
let x: i32 = unsafe { *std::ptr::null() }; //~ ERROR inbounds test failed: 0x0 is not a valid pointer
34
panic!("this should never print: {}", x);

tests/compile-fail/null_pointer_deref_zst.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Some optimizations remove ZST accesses, thus masking this UB.
22
// compile-flags: -Zmir-opt-level=0
33

4+
#[allow(deref_nullptr)]
45
fn main() {
56
let x: () = unsafe { *std::ptr::null() }; //~ ERROR memory access failed: 0x0 is not a valid pointer
67
panic!("this should never print: {:?}", x);
+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[allow(deref_nullptr)]
12
fn main() {
23
unsafe { *std::ptr::null_mut() = 0i32 }; //~ ERROR inbounds test failed: 0x0 is not a valid pointer
34
}

tests/compile-fail/null_pointer_write_zst.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Some optimizations remove ZST accesses, thus masking this UB.
22
// compile-flags: -Zmir-opt-level=0
33

4+
#[allow(deref_nullptr)]
45
fn main() {
56
// Not using the () type here, as writes of that type do not even have MIR generated.
67
// Also not assigning directly as that's array initialization, not assignment.

0 commit comments

Comments
 (0)