External Publication
Visit Post

`BitSlice` or a sound way to implement one

Rust Internals [Unofficial] April 24, 2026
Source

Yeah, we do also have our own separate GAT-friendly traits for doing these bidirectional owned/reference conversions: RefToOwned and OwnedToRef which work better in these cases where we want to carry along some structured data in addition to a reference, which isn't otherwise possible with Borrow and ToOwned.

The particular BitSlice use case though happens to fall more into the territory of a custom DST, or one which is doing things which push the edge of what Rust is currently capable of expressing.

Discussion in the ATmosphere

Loading comments...