-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
We do not coerce &mut &mut T -> *mut mut T
#124692
Merged
bors
merged 1 commit into
rust-lang:master
from
workingjubilee:document-no-double-pointer-coercion-happens
May 4, 2024
Merged
We do not coerce &mut &mut T -> *mut mut T
#124692
bors
merged 1 commit into
rust-lang:master
from
workingjubilee:document-no-double-pointer-coercion-happens
May 4, 2024
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
rustbot
added
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
May 4, 2024
workingjubilee
force-pushed
the
document-no-double-pointer-coercion-happens
branch
from
May 4, 2024 03:09
4911a8c
to
a27c897
Compare
This comment has been minimized.
This comment has been minimized.
workingjubilee
force-pushed
the
document-no-double-pointer-coercion-happens
branch
from
May 4, 2024 03:18
a27c897
to
e404e7a
Compare
compiler-errors
approved these changes
May 4, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely not supported via any current coercion rules, and I don't expect it happening any time soon.
@bors r+ rollup |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
May 4, 2024
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
May 4, 2024
…pointer-coercion-happens, r=compiler-errors We do not coerce `&mut &mut T -> *mut mut T` Resolves rust-lang#34117 by declaring it to be "working as intended" until someone RFCs it or whatever other lang proposal would be required. It seems a bit of a footgun, but perhaps there are strong reasons to allow it anyways. Seeing as how I often have to be mindful to not allow a pointer to coerce the wrong way in my FFI work, I am inclined to think not, but perhaps it's fine in some use-case and that's actually more common?
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 4, 2024
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#123356 (Reduce code size of `thread::set_current`) - rust-lang#124159 (Move thread parking to `sys::sync`) - rust-lang#124293 (Let miri and const eval execute intrinsics' fallback bodies) - rust-lang#124500 (lldb-formatters: Use StdSliceSyntheticProvider for &str) - rust-lang#124677 (Set non-leaf frame pointers on Fuchsia targets) - rust-lang#124692 (We do not coerce `&mut &mut T -> *mut mut T`) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 4, 2024
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#123356 (Reduce code size of `thread::set_current`) - rust-lang#124159 (Move thread parking to `sys::sync`) - rust-lang#124293 (Let miri and const eval execute intrinsics' fallback bodies) - rust-lang#124677 (Set non-leaf frame pointers on Fuchsia targets) - rust-lang#124692 (We do not coerce `&mut &mut T -> *mut mut T`) - rust-lang#124698 (Rewrite `rustdoc-determinism` test in Rust) - rust-lang#124700 (Remove an unnecessary cast) - rust-lang#124701 (Docs: suggest `uN::checked_sub` instead of check-then-unchecked) r? `@ghost` `@rustbot` modify labels: rollup
This seems awfully specific as we generally don't coerce below references (coercions only apply top-level). But sure, why not 🤷 |
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 4, 2024
Rollup merge of rust-lang#124692 - workingjubilee:document-no-double-pointer-coercion-happens, r=compiler-errors We do not coerce `&mut &mut T -> *mut mut T` Resolves rust-lang#34117 by declaring it to be "working as intended" until someone RFCs it or whatever other lang proposal would be required. It seems a bit of a footgun, but perhaps there are strong reasons to allow it anyways. Seeing as how I often have to be mindful to not allow a pointer to coerce the wrong way in my FFI work, I am inclined to think not, but perhaps it's fine in some use-case and that's actually more common?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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.
Resolves #34117 by declaring it to be "working as intended" until someone RFCs it or whatever other lang proposal would be required. It seems a bit of a footgun, but perhaps there are strong reasons to allow it anyways. Seeing as how I often have to be mindful to not allow a pointer to coerce the wrong way in my FFI work, I am inclined to think not, but perhaps it's fine in some use-case and that's actually more common?