Skip to content

Fix autoborrowing when coercing to a mutable raw pointer - #86647

Closed
FabianWolff wants to merge 1 commit into
rust-lang:masterfrom
FabianWolff:issue-86262
Closed

Fix autoborrowing when coercing to a mutable raw pointer#86647
FabianWolff wants to merge 1 commit into
rust-lang:masterfrom
FabianWolff:issue-86262

Conversation

@FabianWolff

Copy link
Copy Markdown
Contributor

This PR fixes#86262. Essentially, the problem is that apply_adjustments() in FnCtxt 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.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @jackh726

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 26, 2021
@jackh726

Copy link
Copy Markdown
Member

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

@Aaron1011

Copy link
Copy Markdown
Contributor

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

@Aaron1011Aaron1011 added T-lang Relevant to the language team I-nominated and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 30, 2021
@nikomatsakis

Copy link
Copy Markdown
Contributor

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.

@Dylan-DPC

Copy link
Copy Markdown
Member

@scottmcm any updates on the follow up?

@bors

bors commented Sep 27, 2022

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #102306) made this pull request unmergeable. Please resolve the merge conflicts.

@JohnCSimon

Copy link
Copy Markdown

@FabianWolff
Ping from triage: I'm closing this due to inactivity, Please reopen when you are ready to continue with this.
Note: if you do please open the PR BEFORE you push to it, else you won't be able to reopen - this is a quirk of github.
Thanks for your contribution.

@rustbot label: +S-inactive

@rustbotrustbot added the S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. label Nov 27, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-inactiveStatus: Inactive and waiting on the author. This is often applied to closed PRs.T-langRelevant to the language team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

as *mut _ does not cause by-mut place evaluation, causing an error stating DerefMut is not implemented, but it is

11 participants

@FabianWolff@rust-highfive@jackh726@Aaron1011@nikomatsakis@Dylan-DPC@bors@JohnCSimon@crlf0710@Mark-Simulacrum@rustbot