-
Notifications
You must be signed in to change notification settings - Fork 108
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
Initial commit of Ptr
type
#406
Merged
Merged
Conversation
This file contains 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
jswrenn
reviewed
Sep 20, 2023
joshlf
force-pushed
the
try-cast-from
branch
8 times, most recently
from
September 26, 2023 18:56
e7060e9
to
d1e5b30
Compare
joshlf
force-pushed
the
try-cast-from
branch
2 times, most recently
from
September 26, 2023 19:19
dd004e4
to
f082458
Compare
joshlf
force-pushed
the
try-cast-from
branch
from
September 26, 2023 19:33
f082458
to
3c81371
Compare
jswrenn
requested changes
Sep 27, 2023
jswrenn
reviewed
Sep 29, 2023
joshlf
force-pushed
the
try-cast-from
branch
4 times, most recently
from
October 11, 2023 14:51
4d58a57
to
708d540
Compare
jswrenn
reviewed
Oct 11, 2023
jswrenn
reviewed
Oct 11, 2023
joshlf
force-pushed
the
try-cast-from
branch
4 times, most recently
from
October 12, 2023 21:41
090a08f
to
97d1484
Compare
Closed
joshlf
force-pushed
the
try-cast-from
branch
2 times, most recently
from
October 16, 2023 19:15
862dfc5
to
2528a71
Compare
`Ptr` is like `NonNull`, but has many restrictions which make it so that using a `Ptr` in unsafe code requires much simpler soundness proofs. In particular, `try_cast_into` attempts to cast a `Ptr<[u8]>` into a `Ptr<U>` where `U: ?Sized + KnownLayout`, and will be built upon in future commits as a building block of `TryFromBytes`. Because `try_cast_into` performs a runtime check to validate alignment, this requires disabling Miri's "symbolic alignment check" feature. While it would be possible to run both with and without that feature in order to still test other code using symbolic alignment checking, I don't think that the benefit is worth a) the complexity of passing the information necessary for certain tests to not run under symbolic alignment checking and, b) the extra CI time to run Miri tests twice. Makes progress on #29
jswrenn
approved these changes
Oct 23, 2023
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.
Ptr
is likeNonNull
, but has many restrictions which make it so that using aPtr
in unsafe code requires much simpler soundness proofs. Notably, it supports atry_cast_into<U>
method whereU: ?Sized + KnownLayout
, which is a building block ofTryFromBytes
.