tweak "make mut" spans when assigning to locals by Ezrashaw · Pull Req...
source link: https://github.com/rust-lang/rust/pull/110583
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Conversation
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
@@ -6,8 +6,8 @@ LL | *input = self.0; | ||
| |
||
help: consider changing that to be a mutable reference |
||
| |
||
LL | fn example(&self, input: &mut i32); // should suggest here |
||
| ~~~~~~~~ |
Contributor
Author
I'm going to leave this for a follow-up PR if that's OK with you?
Contributor
As it is causing a clear visual regression I would prefer to investigate further and try to land the whole fix in a single PR (to avoid risking this slipping into beta by accident simply because we forgot to follow up).
Contributor
This is now fixed, right?
This comment has been minimized.
} else if binding_exists { |
||
// shrink the span to just after the `&` in `&variable` |
||
let span = span.with_lo(span.lo() + BytePos(1)).shrink_to_lo(); |
||
(true, span, "mut ".to_owned()) |
Contributor
For the test presenting the small regression, can you check that you're actually falling into this branch?
Contributor
Author
Yeah it does. The problem is that there is a call to is_error_in_trait
after this function returns which overwrites the returned span (but not the string suggestion) to point to the trait (if local).
Contributor
Author
I've fixed it so that we call is_error_in_trait
before all the suggestion logic and integrate the spans from that. See the latest commit.
added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
labels
This comment has been minimized.
Contributor
The latest upstream changes (presumably #110579) made this pull request unmergeable. Please resolve the merge conflicts. |
LL | fn reborrow_mut<'a>(t: &'a mut &'a mut i32) -> &'a mut i32 where &'a mut i32: Copy { |
||
| ~~~~~~~~~~~~~~~~~~~ |
||
| +++ |
Contributor
Love the result!
Contributor
Sorry I didn't re-review before the merge conflict. r=me after rebase. |
added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
labels
This comment has been minimized.
Contributor
Author
@estebank Since I don't have those fun |
Contributor
@bors r=estebank |
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-author Status: This is awaiting some action (such as code changes or more information) from the author.
labels
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Successfully merging this pull request may close these issues.
None yet
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK