

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
|
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
-
68
F# 4.5预览版现已发布 ,其中提供了一系列新特性,包括对.NET Core 2.1的新原生类型 Span<T> 的支持、新关键字...
-
53
Over the past two decades, the demise of the printed book has become a familiar story: the digital medium is killing print and destroying our capacity...
-
17
Copy link Contributor petrochenkov commented
-
10
TechApple’s conflict with Facebook goes back to the days of Steve Jobs, emails showPublished Tue, May 4 20219:09 AM EDTUpdated Tue, May 4 202112:57...
-
10
Copy link Contributor Author est31 comme...
-
7
Technology 2 weeks ago Last updated April 14th, 2022 712 Reads How to Fix the Error “Mozilla Thunderbird not Starting”? Image Credit: unsplash.com ...
-
22
Spancat: a new approach for span labelingJun 14, 2022 · by Edward Schmuhl, Lj Miranda, Ákos Kádár, Sofie Van Landeghem & Ad...
-
6
Drawing custom text spans in Compose UI While exploring how text paragraphs are rendered in Compose UI, I nerd sniped myself into porting
-
5
Conversation Shrink the spans of clippy::missing_*_doc to match missing_docs
-
4
Conversation Contributor...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK