File tree 2 files changed +3
-3
lines changed
src/tools/miri/tests/fail/dangling_pointers
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -7,5 +7,5 @@ fn main() {
7
7
// Also not assigning directly as that's array initialization, not assignment.
8
8
let zst_val = [ 1u8 ; 0 ] ;
9
9
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
11
11
}
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)
2
2
--> $DIR/null_pointer_write_zst.rs:LL:CC
3
3
|
4
4
LL | 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)
6
6
|
7
7
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
8
8
= 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