-
Notifications
You must be signed in to change notification settings - Fork 138
Open
Description
TryTransmuteFromPtronly needs that the set ofDV-valid referents ofdstis a subset of the set ofSV-valid referents ofsrc. Note that this is slightly different than saying that the set ofDV-valid values ofDstis a subset of the set ofSV-valid values ofSrc. In particular:- The former statement takes into account that we only care about a particular size of
SrcandDst– we don't need to reason about other sizes (other than the size of this particular referent) - The former statement is only useful when we're talking about size-preserving transmutes. If we're talking about size-shrinking, then this is insufficient.
- The former statement takes into account that we only care about a particular size of
Plan:
- Step 1: Nail down current semantics, which don't permit shrinking transmutes
- Update
TryTransmuteFromPtrwith the requirement that "set ofDV-valid referents ofdstis a subset of the set ofSV-valid referents ofsrc" - Update the proof on the impl of
TryTransmuteFromPtrwhich does permits reverse transmutation – update it so that it relies onSizeEq::CastFrom::projectbeing size-preserving. - This is done: Clarify semantics of size-preserving transmutes #2911
- Update
- Step 2: Remove
TryTransmuteFromPtr: SizeEqsuper-trait bound and permit any size-preserving transmute- This is done: [transmute] Remove
SizeEqsuper-trait bound #2920
- This is done: [transmute] Remove
- Step 3: Permit shrinking transmutes
- Allow
SizeEq::CastFromto perform shrinking transmutes - Update
TryTransmuteFromPtrto handle both non-shrinking and shrinking transmutes (including the cases of immutable shrinking and mutable shrinking (which permits overwriting/tearing)) - Update the proof on the impl of
TryTransmuteFromPtrwhich does permit reverse transmutation – add aSizeEq::CastFrom: CastExactbound so that it does not support shrinking - The impl of
TryTransmuteFromPtrwhich bans reverse transmutation (for sharedImmutablepointers) now naturally supports shrinking
- Allow
- Step 4: Support overwriting transmutes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels