File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
src/tools/miri/tests/fail/dangling_pointers Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -7,5 +7,5 @@ fn main() {
77 // Also not assigning directly as that's array initialization, not assignment.
88 let zst_val = [ 1u8 ; 0 ] ;
99 unsafe { std:: ptr:: null_mut :: < [ u8 ; 0 ] > ( ) . write ( zst_val) } ;
10- //~^ERROR: memory access failed: null pointer is a dangling pointer
10+ //~^ERROR: dereferencing pointer failed: null pointer is a dangling pointer
1111}
Original file line number Diff line number Diff line change 1- error: Undefined Behavior: memory access failed: null pointer is a dangling pointer (it has no provenance)
1+ error: Undefined Behavior: dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance)
22 --> $DIR/null_pointer_write_zst.rs:LL:CC
33 |
44LL | unsafe { std::ptr::null_mut::<[u8; 0]>().write(zst_val) };
5- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: null pointer is a dangling pointer (it has no provenance)
5+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: null pointer 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
You can’t perform that action at this time.
0 commit comments