Update reference safety requirements#125021
Merged
bors merged 2 commits intorust-lang:masterfrom May 12, 2024
Merged
Conversation
Per rust-lang#116677 (comment), the language as written promises too much. This PR relaxes the language to be consistent with current semantics. If and when rust-lang#117945 is implemented, we can revert to the old language.
Collaborator
1 task
Member
|
This is probably good even with #117945, as it avoids having to explain what "dereferenceable for 0 bytes" means. But maybe we should add that the reference is non-null? This is always true, and will remain so. |
Contributor
Author
Updated the PR. |
Member
|
Cc @rust-lang/opsem @rust-lang/lang -- I think this just clarifies the existing rules @bors r+ rollup |
Collaborator
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this pull request
May 12, 2024
Update reference safety requirements Per rust-lang#116677 (comment), the language as written promises too much. This PR relaxes the language to be consistent with current semantics. If and when rust-lang#117945 is implemented, we can revert to the old language. While we're here, we also require that references be non-null. cc `@RalfJung`
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 12, 2024
…llaumeGomez Rollup of 4 pull requests Successful merges: - rust-lang#124807 (Migrate `run-make/rustdoc-io-error` to `rmake.rs`) - rust-lang#125021 (Update reference safety requirements) - rust-lang#125030 (Fix some minor issues from the ui-test auto-porting) - rust-lang#125036 (solve: all "non-structural" logging to trace) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 12, 2024
…llaumeGomez Rollup of 4 pull requests Successful merges: - rust-lang#125021 (Update reference safety requirements) - rust-lang#125022 (Migrate rustdoc scrape examples ordering) - rust-lang#125030 (Fix some minor issues from the ui-test auto-porting) - rust-lang#125036 (solve: all "non-structural" logging to trace) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 12, 2024
Rollup merge of rust-lang#125021 - joshlf:patch-11, r=RalfJung Update reference safety requirements Per rust-lang#116677 (comment), the language as written promises too much. This PR relaxes the language to be consistent with current semantics. If and when rust-lang#117945 is implemented, we can revert to the old language. While we're here, we also require that references be non-null. cc ``@RalfJung``
87 tasks
joshlf
added a commit
to google/zerocopy
that referenced
this pull request
Sep 7, 2024
Now that [1] is completed, zero-sized accesses no longer require provenance. Per [2], zero-sized references are no longer required to be dereferenceable, and so may not carry provenance. This commit updates `Ptr`'s invariants to not require provenance or a valid allocation when its referent is zero-sized. [1] rust-lang/rust#117945 [2] rust-lang/rust#125021
joshlf
added a commit
to google/zerocopy
that referenced
this pull request
Sep 7, 2024
Now that [1] is completed, zero-sized accesses no longer require provenance. Per [2], zero-sized references are no longer required to be dereferenceable, and so may not carry provenance. This commit updates `Ptr`'s invariants to not require provenance or a valid allocation when its referent is zero-sized. [1] rust-lang/rust#117945 [2] rust-lang/rust#125021 Closes #874
github-merge-queue bot
pushed a commit
to google/zerocopy
that referenced
this pull request
Sep 7, 2024
Now that [1] is completed, zero-sized accesses no longer require provenance. Per [2], zero-sized references are no longer required to be dereferenceable, and so may not carry provenance. This commit updates `Ptr`'s invariants to not require provenance or a valid allocation when its referent is zero-sized. [1] rust-lang/rust#117945 [2] rust-lang/rust#125021 Closes #874
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
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.
Per #116677 (comment), the language as written promises too much. This PR relaxes the language to be consistent with current semantics. If and when #117945 is implemented, we can revert to the old language.
While we're here, we also require that references be non-null.
cc @RalfJung