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

simplify describe_field func in borrowck's diagnostics part #96386

Merged
merged 1 commit into from
Apr 26, 2022

Conversation

SparrowLii
Copy link
Member

This PR simplify the describe_field func in borrowck's diagnostics part, besides fix the FIXME in it.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 25, 2022
@rust-highfive
Copy link
Collaborator

r? @jackh726

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 25, 2022
Copy link
Member

@jackh726 jackh726 left a comment

Choose a reason for hiding this comment

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

One small thing

let local = &self.body.local_decls[local];
self.describe_field_from_ty(local.ty, field, None)
}
let place_ty = match place {
Copy link
Member

Choose a reason for hiding this comment

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

This could instead just be ty: Ty<_> right? Then in the empty projection case, we don't need to wrap in a PlaceTy?

Copy link
Member Author

@SparrowLii SparrowLii Apr 26, 2022

Choose a reason for hiding this comment

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

I'm guessing you might be talking about PlaceRef? We need to know the value of variant_index, and the structure of PlaceTy fits well. Do you think it is better to separate Ty and variant_index for semantic clarity?

Copy link
Member

Choose a reason for hiding this comment

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

Whoops I missed the variant index.

@jackh726
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Apr 26, 2022

📌 Commit 74853ee has been approved by jackh726

@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 Apr 26, 2022
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Apr 26, 2022
simplify `describe_field` func in borrowck's diagnostics part

This PR simplify the `describe_field` func in borrowck's diagnostics part, besides fix the FIXME in it.
This was referenced Apr 26, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 26, 2022
…laumeGomez

Rollup of 8 pull requests

Successful merges:

 - rust-lang#94022 (Clarify that `Cow::into_owned` returns owned data)
 - rust-lang#94703 (Fix codegen bug in "ptx-kernel" abi related to arg passing)
 - rust-lang#95949 (Implement Default for AssertUnwindSafe)
 - rust-lang#96361 (Switch JS code to ES6)
 - rust-lang#96372 (Suggest calling method on nested field when struct is missing method)
 - rust-lang#96386 (simplify `describe_field` func in borrowck's diagnostics part)
 - rust-lang#96400 (Correct documentation for `Rvalue::ShallowInitBox`)
 - rust-lang#96415 (Remove references to git.io)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit a818173 into rust-lang:master Apr 26, 2022
@rustbot rustbot added this to the 1.62.0 milestone Apr 26, 2022
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.

5 participants