Skip to content

simplify describe_field func in borrowck's diagnostics part - #96386

Merged
bors merged 1 commit into
rust-lang:masterfrom
SparrowLii:des_field
Apr 26, 2022
Merged

simplify describe_field func in borrowck's diagnostics part#96386
bors merged 1 commit into
rust-lang:masterfrom
SparrowLii:des_field

Conversation

@SparrowLii

Copy link
Copy Markdown
Member

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

@rustbotrustbot 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
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 Apr 25, 2022

@jackh726jackh726 left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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?

@SparrowLiiSparrowLiiApr 26, 2022

Copy link
Copy Markdown
MemberAuthor

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
Copy Markdown
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
Copy Markdown
Member

@bors r+ rollup

@bors

bors commented Apr 26, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit 74853ee has been approved by jackh726

@borsbors 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:masterApr 26, 2022
@rustbotrustbot added this to the 1.62.0 milestone Apr 26, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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

@SparrowLii@rust-highfive@jackh726@bors@rustbot