-
Couldn't load subscription status.
- Fork 127
[WIP] Update TransmuteFrom safety proofs
#2469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
joshlf
wants to merge
2
commits into
I6c793a9620ad75bdc0d26ab7c7cd1a0c7bef1b8b
from
I32ffeea758b53073aa461ab41c217e5b8f0bc4e4
Closed
[WIP] Update TransmuteFrom safety proofs
#2469
joshlf
wants to merge
2
commits into
I6c793a9620ad75bdc0d26ab7c7cd1a0c7bef1b8b
from
I32ffeea758b53073aa461ab41c217e5b8f0bc4e4
Conversation
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
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## I6c793a9620ad75bdc0d26ab7c7cd1a0c7bef1b8b #2469 +/- ##
==========================================================================
Coverage 90.18% 90.18%
==========================================================================
Files 20 20
Lines 7986 7986
==========================================================================
Hits 7202 7202
Misses 784 784 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
2890b20 to
cab910e
Compare
85b4437 to
522d450
Compare
9ab2be6 to
c1009fc
Compare
09ffdb2 to
dbcd3c0
Compare
c1009fc to
6338896
Compare
dbcd3c0 to
dc675e6
Compare
6338896 to
2115a6d
Compare
dc675e6 to
eec3ec9
Compare
2115a6d to
7b9a12f
Compare
eec3ec9 to
bafb400
Compare
7b9a12f to
baf0a15
Compare
baf0a15 to
9ac6a2d
Compare
bafb400 to
0386dc9
Compare
9ac6a2d to
7733216
Compare
0386dc9 to
8793f97
Compare
7733216 to
cd6fc04
Compare
8793f97 to
491b473
Compare
491b473 to
0e678af
Compare
674049b to
bd549b9
Compare
ed98af3 to
f9e4d83
Compare
bd549b9 to
c9af062
Compare
This requires us to generalize our prior support for transmuting between unsized types. In particular, we previously used the `SizeEq` trait to denote that two types have equal sizes in the face of a cast operation (in particular, that `*const T as *const U` preserves referent size). In this commit, we add support for metadata fix-up, which means that we support casts for which `*const T as *const U` does *not* preserve referent size. Instead, we compute an affine function at compile time and apply it at runtime - computing the destination type's metadata as a function of the source metadata, `dst_meta = A + src_meta * B`. `A` and `B` are computed at compile time. We generalize `SizeEq` to permit its `cast_from_raw` method to perform a runtime metadata fix-up operation. Makes progress on #1817 Co-authored-by: Jack Wrenn <[email protected]> gherrit-pr-id: I6c793a9620ad75bdc0d26ab7c7cd1a0c7bef1b8b
gherrit-pr-id: I32ffeea758b53073aa461ab41c217e5b8f0bc4e4
f9e4d83 to
a7bb504
Compare
5a377c4 to
7a0c2de
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is on branch transmute-ref-dst.
TransmuteFromsafety proofs #2469