diff options
| author | Markus Reiter <me@reitermark.us> | 2024-02-08 23:03:25 +0100 |
|---|---|---|
| committer | Markus Reiter <me@reitermark.us> | 2024-02-15 08:09:42 +0100 |
| commit | a90cc05233858fcd16c3ca0e0b4320fc5ae09af2 (patch) | |
| tree | 003c31cd913ce7f1acb1bd12aeca0fcde1ccfee6 /compiler/rustc_data_structures/src | |
| parent | 746a58d4359786e4aebb372a30829706fa5a968f (diff) | |
| download | rust-a90cc05233858fcd16c3ca0e0b4320fc5ae09af2.tar.gz rust-a90cc05233858fcd16c3ca0e0b4320fc5ae09af2.zip | |
Replace `NonZero::<_>::new` with `NonZero::new`.
Diffstat (limited to 'compiler/rustc_data_structures/src')
| -rw-r--r-- | compiler/rustc_data_structures/src/tagged_ptr/copy.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_data_structures/src/tagged_ptr/copy.rs b/compiler/rustc_data_structures/src/tagged_ptr/copy.rs index 8af4042ad87..ff4208def31 100644 --- a/compiler/rustc_data_structures/src/tagged_ptr/copy.rs +++ b/compiler/rustc_data_structures/src/tagged_ptr/copy.rs @@ -143,15 +143,14 @@ where // `{non_zero} | packed_tag` can't make the value zero. let packed = (addr.get() >> T::BITS) | packed_tag; - unsafe { NonZero::<usize>::new_unchecked(packed) } + unsafe { NonZero::new_unchecked(packed) } }) } /// Retrieves the original raw pointer from `self.packed`. #[inline] pub(super) fn pointer_raw(&self) -> NonNull<P::Target> { - self.packed - .map_addr(|addr| unsafe { NonZero::<usize>::new_unchecked(addr.get() << T::BITS) }) + self.packed.map_addr(|addr| unsafe { NonZero::new_unchecked(addr.get() << T::BITS) }) } /// This provides a reference to the `P` pointer itself, rather than the |
