Deprecate the unstable `ptr_to_from_bits` feature I propose that we deprecate the (unstable!) `to_bits` and `from_bits` methods on raw pointers. (With the intent to ~~remove them once `addr` has been around long enough to make the transition easy on people -- maybe another 6 weeks~~ remove them fairly soon after, as the strict and expose versions have been around for a while already.) The APIs that came from the strict provenance explorations (#95228) are a more holistic version of these, and things like `.expose_addr()` work for the "that cast looks sketchy" case even if the full strict provenance stuff never happens. (As a bonus, `addr` is even shorter than `to_bits`, though it is only applicable if people can use full strict provenance! `addr` is *not* a direct replacement for `to_bits`.) So I think it's fine to move away from the `{to|from}_bits` methods, and encourage the others instead. That also resolves the worry that was brought up (I forget where) that `q.to_bits()` and `(*q).to_bits()` both work if `q` is a pointer-to-floating-point, as they also have a `to_bits` method. Tracking issue #91126 Code search: https://github.com/search?l=Rust&p=1&q=ptr_to_from_bits&type=Code For potential pushback, some users in case they want to chime in - `@RSSchermer` |
||
|---|---|---|
| .. | ||
| benches | ||
| primitive_docs | ||
| src | ||
| tests | ||
| Cargo.toml | ||