Skip to content

Commit 38b5f23

Browse files
committed
Auto merge of #1790 - hyd-dev:rustup, r=RalfJung
Update pointer error messages cc rust-lang/rust#85027
2 parents ee8dbbc + 1ab9fd5 commit 38b5f23

11 files changed

+11
-11
lines changed

rust-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1773f14a24c49356b384e45ebb45643bc9bef2c4
1+
e002ac7e8a1eb04961a722c44b3ffbad575a6caa

tests/compile-fail/backtrace/bad-backtrace-ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ extern "Rust" {
44

55
fn main() {
66
unsafe {
7-
miri_resolve_frame(0 as *mut _, 0); //~ ERROR 0x0 is not a valid pointer
7+
miri_resolve_frame(0 as *mut _, 0); //~ ERROR null pointer is not a valid pointer for this operation
88
}
99
}

tests/compile-fail/dangling_pointers/deref-invalid-ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33

44
fn main() {
55
let x = 16usize as *const u32;
6-
let _y = unsafe { &*x as *const u32 }; //~ ERROR inbounds test failed: 0x10 is not a valid pointer
6+
let _y = unsafe { &*x as *const u32 }; //~ ERROR 0x10 is not a valid pointer
77
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fn main() {
22
let p = 44 as *const i32;
3-
let x = unsafe { *p }; //~ ERROR inbounds test failed: 0x2c is not a valid pointer
3+
let x = unsafe { *p }; //~ ERROR 0x2c is not a valid pointer
44
panic!("this should never print: {}", x);
55
}

tests/compile-fail/function_pointers/cast_int_to_fn_ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ fn main() {
66
std::mem::transmute::<usize, fn(i32)>(42)
77
};
88

9-
g(42) //~ ERROR inbounds test failed: 0x2a is not a valid pointer
9+
g(42) //~ ERROR 0x2a is not a valid pointer
1010
}

tests/compile-fail/intrinsics/ptr_offset_0_plus_0.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// error-pattern: inbounds test failed: 0x0 is not a valid pointer
1+
// error-pattern: pointer arithmetic failed: 0x0 is not a valid pointer
22

33
fn main() {
44
let x = 0 as *mut i32;

tests/compile-fail/intrinsics/ptr_offset_int_plus_int.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// error-pattern: inbounds test failed: 0x1 is not a valid pointer
1+
// error-pattern: 0x1 is not a valid pointer
22

33
fn main() {
44
// Can't offset an integer pointer by non-zero offset.

tests/compile-fail/intrinsics/ptr_offset_int_plus_ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// error-pattern: inbounds test failed: 0x1 is not a valid pointer
1+
// error-pattern: 0x1 is not a valid pointer
22

33
fn main() {
44
let ptr = Box::into_raw(Box::new(0u32));
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[allow(deref_nullptr)]
22
fn main() {
3-
let x: i32 = unsafe { *std::ptr::null() }; //~ ERROR inbounds test failed: 0x0 is not a valid pointer
3+
let x: i32 = unsafe { *std::ptr::null() }; //~ ERROR null pointer is not a valid pointer for this operation
44
panic!("this should never print: {}", x);
55
}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#[allow(deref_nullptr)]
22
fn main() {
3-
unsafe { *std::ptr::null_mut() = 0i32 }; //~ ERROR inbounds test failed: 0x0 is not a valid pointer
3+
unsafe { *std::ptr::null_mut() = 0i32 }; //~ ERROR null pointer is not a valid pointer for this operation
44
}

tests/compile-fail/stacked_borrows/issue-miri-1050-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// error-pattern: inbounds test failed: 0x4 is not a valid pointer
1+
// error-pattern: 0x4 is not a valid pointer
22
use std::ptr::NonNull;
33

44
fn main() { unsafe {

0 commit comments

Comments
 (0)