diff options
| author | Trevor Gross <t.gross35@gmail.com> | 2025-02-23 14:30:28 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-23 14:30:28 -0500 |
| commit | 18ffee2126f71fe15a677d718bd27c501b0ccf52 (patch) | |
| tree | fe3e70c924cb7571769b4e45d4a8e8f89d46a888 /compiler | |
| parent | e8342e7d42bf789b6d69caaeafd547f6e7deadc2 (diff) | |
| parent | c813d8f3e49aa4c85c9eded426b6507701a2ff94 (diff) | |
| download | rust-18ffee2126f71fe15a677d718bd27c501b0ccf52.tar.gz rust-18ffee2126f71fe15a677d718bd27c501b0ccf52.zip | |
Rollup merge of #137483 - bend-n:😅, r=Noratrieb
rename sub_ptr to offset_from_unsigned i also made `byte_sub_ptr` `byte_offset_from_unsigned` fixes #137121 tracking issue #95892
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_serialize/src/opaque.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_serialize/src/opaque.rs b/compiler/rustc_serialize/src/opaque.rs index 27e9f817894..d4907b69b72 100644 --- a/compiler/rustc_serialize/src/opaque.rs +++ b/compiler/rustc_serialize/src/opaque.rs @@ -280,13 +280,13 @@ impl<'a> MemDecoder<'a> { #[inline] pub fn len(&self) -> usize { // SAFETY: This recovers the length of the original slice, only using members we never modify. - unsafe { self.end.sub_ptr(self.start) } + unsafe { self.end.offset_from_unsigned(self.start) } } #[inline] pub fn remaining(&self) -> usize { // SAFETY: This type guarantees current <= end. - unsafe { self.end.sub_ptr(self.current) } + unsafe { self.end.offset_from_unsigned(self.current) } } #[cold] @@ -400,7 +400,7 @@ impl<'a> Decoder for MemDecoder<'a> { #[inline] fn position(&self) -> usize { // SAFETY: This type guarantees start <= current - unsafe { self.current.sub_ptr(self.start) } + unsafe { self.current.offset_from_unsigned(self.start) } } } |
