diff options
| author | bendn <bend.n@outlook.com> | 2025-02-23 20:26:28 +0700 |
|---|---|---|
| committer | bendn <bend.n@outlook.com> | 2025-02-23 23:11:00 +0700 |
| commit | c813d8f3e49aa4c85c9eded426b6507701a2ff94 (patch) | |
| tree | e40e0f5366b247f274c1107760ae404bac216b57 /tests | |
| parent | 1805b3348341e0918912ab61cb1dffad41648d23 (diff) | |
| download | rust-c813d8f3e49aa4c85c9eded426b6507701a2ff94.tar.gz rust-c813d8f3e49aa4c85c9eded426b6507701a2ff94.zip | |
rename sub_ptr 😅
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/const-ptr/forbidden_slices.stderr | 6 | ||||
| -rw-r--r-- | tests/ui/consts/offset_from.rs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/ui/const-ptr/forbidden_slices.stderr b/tests/ui/const-ptr/forbidden_slices.stderr index 2e0c04dcf1e..df588fcc5e1 100644 --- a/tests/ui/const-ptr/forbidden_slices.stderr +++ b/tests/ui/const-ptr/forbidden_slices.stderr @@ -104,7 +104,7 @@ error[E0080]: could not evaluate static initializer | = note: the evaluated program panicked at 'assertion failed: 0 < pointee_size && pointee_size <= isize::MAX as usize', $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | -note: inside `std::ptr::const_ptr::<impl *const ()>::sub_ptr` +note: inside `std::ptr::const_ptr::<impl *const ()>::offset_from_unsigned` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL note: inside `from_ptr_range::<'_, ()>` --> $SRC_DIR/core/src/slice/raw.rs:LL:COL @@ -192,7 +192,7 @@ error[E0080]: could not evaluate static initializer | = note: `ptr_offset_from_unsigned` called on two different pointers that are not both derived from the same allocation | -note: inside `std::ptr::const_ptr::<impl *const u32>::sub_ptr` +note: inside `std::ptr::const_ptr::<impl *const u32>::offset_from_unsigned` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL note: inside `from_ptr_range::<'_, u32>` --> $SRC_DIR/core/src/slice/raw.rs:LL:COL @@ -207,7 +207,7 @@ error[E0080]: could not evaluate static initializer | = note: `ptr_offset_from_unsigned` called on two different pointers that are not both derived from the same allocation | -note: inside `std::ptr::const_ptr::<impl *const u32>::sub_ptr` +note: inside `std::ptr::const_ptr::<impl *const u32>::offset_from_unsigned` --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL note: inside `from_ptr_range::<'_, u32>` --> $SRC_DIR/core/src/slice/raw.rs:LL:COL diff --git a/tests/ui/consts/offset_from.rs b/tests/ui/consts/offset_from.rs index c06314ac7df..02e8d145f65 100644 --- a/tests/ui/consts/offset_from.rs +++ b/tests/ui/consts/offset_from.rs @@ -44,7 +44,7 @@ pub const OFFSET_EQUAL_INTS: isize = { pub const OFFSET_UNSIGNED: usize = { let a = ['a', 'b', 'c']; let ptr = a.as_ptr(); - unsafe { ptr.add(2).sub_ptr(ptr) } + unsafe { ptr.add(2).offset_from_unsigned(ptr) } }; fn main() { |
