i would like to get the ball rolling on stabilizing as many of the pointer APIs that were introduced in the last year
APIs:
- feature(ptr_sub_ptr)
- feature(ptr_mask)
- feature(pointer_is_aligned)
- feature(ptr_alignment_type)
- feature(strict_provenance)
- feature(exposed_addr)
Initial Discussion:
- feature(ptr_sub_ptr)
- โ minor name bikeshedding, the name is fine
- ๐ should add
byte_sub_ptras feature(pointer_bytes_offset) is stable now- impl: rust-lang/rust#121919
- feature(ptr_mask)
- โ seems free to stabilize as-is, although its docs refer to a strict_provenance API
- feature(pointer_is_aligned)
- โ
is_aligneduncontroversial/good โ ๏ธ is_aligned_tomore controversial because it has to handle non-power of twos- proposed deprecate as insufficient motivation
- impl: rust-lang/rust#121920
- waffle proposes unspecified behaviour (i agree this is reasonable)
- mara proposes
is_aligned_for::<T>()as more egnomic for most practical cases (also agree) - scott proposes
core::ptr::Alignment(see next ptr_alignment_type below)
- proposed deprecate as insufficient motivation
- โ
- feature(ptr_alignment_type)
- โ people are apparently hungering for this, so we should just stabilize it
โ ๏ธ "blocked" on it being weird that nothing in std actually uses it- Layout "should" use it
- some version of
pointer::is_aligned_to"should" use it
- feature(strict_provenance)
โ ๏ธ addr,with_addr, andmap_addrall seem very good and inoffensive in a vacuum, but i strongly believe they shouldn't be stabilized without their exposing partners to form a fully consistent system to follow for strict provenance- ๐
invalidandinvalid_mutare in a more dubious place- does not appropriately address the needs of hardcoded memory addresses or "from FFI"
- feature(exposed_addr)
โ ๏ธ expose_addr,from_exposed_addr, andfrom_exposed_addr_mutall form a consistent system but people are cagey about them- i personally think they can just be stabilized with caveats that the semantics are opt-in and you're not "fucking up" if you fail to uphold them