Simplify projection methods by joshlf · Pull Request #2895 · google/zerocopy

This was referenced

Jan 16, 2026

gemini-code-assist[bot]

Base automatically changed from G2eb58496ed1e3c61421020abbbb694d970d43c1c to main

January 16, 2026 23:20

@joshlf

Remove high-level `HasField::project_inner`, and rename
`HasField::project_raw` to `HasField::project`.

The new plan is for `pointer::cast::Project` and `HasField` to only have
`project` methods which project from `PtrInner<Src>` to `*mut Dst`, and
for callers who want `PtrInner -> PtrInner` or `Ptr -> Ptr` to use
inherent methods on `PtrInner` and `Ptr`. Compared to a default-impl'd
method on `HasField`, this reduces indirection and reduces pressure on
the optimizer.

Reverts #2884, #2885

gherrit-pr-id: G481927cb6e9ca76c1531c05465f608e1b2607a62

@joshlf joshlf deleted the G481927cb6e9ca76c1531c05465f608e1b2607a62 branch

January 17, 2026 00:37