Skip to content
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

Improve suggestion to change struct field to &mut #91516

Merged
merged 2 commits into from
Dec 18, 2021

Conversation

rukai
Copy link
Contributor

@rukai rukai commented Dec 4, 2021

r? @estebank

Now displays a proper underline style suggestion instead of including the code change inline with the message.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 4, 2021
@apiraino apiraino added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Dec 9, 2021
@bors
Copy link
Contributor

bors commented Dec 17, 2021

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

@estebank
Copy link
Contributor

r=me after rebasing

@rukai rukai force-pushed the improve_mut_addition_help branch from e535856 to 97bf7b9 Compare December 17, 2021 02:24
@rukai
Copy link
Contributor Author

rukai commented Dec 17, 2021

r=estebank

Copy link
Contributor

@estebank estebank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nitpick

format!("&{}mut {}", lifetime_snippet, &*type_snippet,),
));
return Some(
lifetime.span.with_hi(lifetime.span.hi() + BytePos(1)).shrink_to_hi(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lifetime.span.with_hi(lifetime.span.hi() + BytePos(1)).shrink_to_hi(),
lifetime.span.between(ty.span),

lifetime,
hir::MutTy { mutbl: hir::Mutability::Not, ref ty },
) = field.ty.kind
if let hir::TyKind::Rptr(lifetime, hir::MutTy { mutbl: hir::Mutability::Not, .. }) =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if let hir::TyKind::Rptr(lifetime, hir::MutTy { mutbl: hir::Mutability::Not, .. }) =
if let hir::TyKind::Rptr(lifetime, hir::MutTy { mutbl: hir::Mutability::Not, ty }) =

@rukai
Copy link
Contributor Author

rukai commented Dec 18, 2021

Ended up having to change some other things to get it working like that. Does this look good?

Also I'd like to know what the r=me after rebasing command does?

@rukai rukai force-pushed the improve_mut_addition_help branch from f444260 to e573075 Compare December 18, 2021 02:00
@estebank
Copy link
Contributor

@bors r+ rollup

Also I'd like to know what the r=me after rebasing command does?

you can do @bors r=estebank if you have permissions, but we also use r=me as a shorthand for "rebase and I'll approve when I see that you've done so, after you've rebased you can stop thinking about this PR".

@bors
Copy link
Contributor

bors commented Dec 18, 2021

📌 Commit e573075 has been approved by estebank

@bors 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 Dec 18, 2021
@bors
Copy link
Contributor

bors commented Dec 18, 2021

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Contributor

bors commented Dec 18, 2021

📌 Commit e573075 has been approved by `estebank``

@estebank
Copy link
Contributor

@bors r=estebank

@bors
Copy link
Contributor

bors commented Dec 18, 2021

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Contributor

bors commented Dec 18, 2021

📌 Commit e573075 has been approved by estebank

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 18, 2021
…estebank

Improve suggestion to change struct field to &mut

r? `@estebank`

Now displays a proper underline style suggestion instead of including the code change inline with the message.
This was referenced Dec 18, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 18, 2021
…askrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#91439 (Mark defaulted `PartialEq`/`PartialOrd` methods as const)
 - rust-lang#91516 (Improve suggestion to change struct field to &mut)
 - rust-lang#91896 (Remove `in_band_lifetimes` for `rustc_passes`)
 - rust-lang#91909 (:arrow_up: rust-analyzer)
 - rust-lang#91922 (Remove `in_band_lifetimes` from `rustc_mir_dataflow`)
 - rust-lang#92025 (Revert "socket ancillary data implementation for dragonflybsd.")
 - rust-lang#92030 (Update stdlib to the 2021 edition)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 57d49f1 into rust-lang:master Dec 18, 2021
@rustbot rustbot added this to the 1.59.0 milestone Dec 18, 2021
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants