-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Fix autoborrowing when coercing to a mutable raw pointer #86647
Conversation
r? @jackh726 (rust-highfive has picked a reviewer for you, use r? to override) |
Not too familiar with this code. And seems pretty important in terms of soundness. So I don't feel comfortable reviewing this myself. Trying to pick someone randomly, but avoiding people that aren't around atm; let's r? @Aaron1011 |
This seems to make sense, but I wonder if there's some language design reason why this wasn't previously allowed. cc @rust-lang/lang |
Discussed in the @rust-lang/lang team meeting today. We weren't really sure what is being proposed here! @scottmcm is going to follow up and try to figure out how to describe the effects of this proposed PR on the language itself. |
@scottmcm any updates on the follow up? |
☔ The latest upstream changes (presumably #102306) made this pull request unmergeable. Please resolve the merge conflicts. |
@FabianWolff @rustbot label: +S-inactive |
This PR fixes #86262. Essentially, the problem is that
apply_adjustments()
inFnCtxt
currently only takes mutability of references into account for automatic borrows, while it should also consider mutable raw pointers. I have fixed this, so that the example in #86262 compiles with my changes.