Teach generic transmutability to reason about size inequality and unsized types
- Dominant language
- Rust
- Stars
- 2.6k
- Forks
- 179
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 29
Description
We would like to support all combinations of the following axes
- Src type sized or unsized
- Dst type sized or unsized
- Src larger than, same size as, or smaller than Dst type for the same fat pointer metadata
- Includes when Src is sized and Dst is unsized and vice-versa
- Dst same size as Src given a metadata fix-up operation
Some specific operations we could support:
- Sizes same w/o metadata fix-up: permits shared and exclusive reference casts
- For same metadata, Dst smaller than Src: supports shared reference casts
- When both types are sized: supports by-value transmute
- For same metadata, Dst larger than Src: supports by-value transmute if uninit bytes are valid at the end of Dst
- Sizes same given metadata fix-up: shared and exclusive casts (with metadata fix-up)
Contributor guide
Assessment
This issue has not been assessed yet.