rust/library/core/src/ptr
bors 7e4f4660eb Auto merge of #104977 - RalfJung:ptr-from-ref, r=dtolnay
add ptr::from_{ref,mut}

We have methods to avoid almost all `as` casts around raw pointer handling, except for the initial cast from reference to raw pointer. These new methods close that gap.

(I also moved `null_mut` next to `null` to keep the file consistently organized.)

r? libs-api

Tracking issue: https://github.com/rust-lang/rust/issues/106116
2022-12-24 17:14:26 +00:00
..
alignment.rs Fix issue number 2022-11-20 15:01:21 -05:00
const_ptr.rs Make <*{const,mut} T>::{,wrapping_}sub methods #[inline(always)] 2022-12-09 20:30:06 +01:00
metadata.rs Add rustc_deny_explicit_impl 2022-11-14 03:23:41 +00:00
mod.rs Auto merge of #104977 - RalfJung:ptr-from-ref, r=dtolnay 2022-12-24 17:14:26 +00:00
mut_ptr.rs Make <*{const,mut} T>::{,wrapping_}sub methods #[inline(always)] 2022-12-09 20:30:06 +01:00
non_null.rs Update coerce_unsized tracking issue from #27732 to #18598 2022-12-19 23:09:47 -08:00
unique.rs Implement core::ptr::Unique on top of NonNull 2022-04-14 19:35:40 +02:00