]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #104977 - RalfJung:ptr-from-ref, r=dtolnay
authorbors <bors@rust-lang.org>
Sat, 24 Dec 2022 17:14:26 +0000 (17:14 +0000)
committerbors <bors@rust-lang.org>
Sat, 24 Dec 2022 17:14:26 +0000 (17:14 +0000)
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

1  2 
library/core/src/ptr/mod.rs

Simple merge