[pointer] Add generic projection/cast framework by joshlf · Pull Request #2860 · google/zerocopy
This was referenced
Dec 30, 2025This was referenced
Jan 2, 2026Add `unsafe trait Project` and `unsafe trait Cast: Project`. `Cast` is implemented for any address-preserving cast, while `Project` generalizes to conversions which may not preserve the address of the referent (ie, field projections). Use these (mostly `Cast`, but some `Project`) to unify `PtrInner`/`Ptr` casts, field projections, and `SizeEq` casts. Replace a good amount of unsafe derive-generated code with uses of this machinery. Makes progress on #196 Closes #2856 gherrit-pr-id: Gdeb4f5a282b778a82175703218739a93074d0cc4
joshlf
deleted the
Gdeb4f5a282b778a82175703218739a93074d0cc4
branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters