-
Notifications
You must be signed in to change notification settings - Fork 13.5k
simplify describe_field
func in borrowck's diagnostics part
#96386
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
r? @jackh726 (rust-highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
@bors r+ rollup |
📌 Commit 74853ee has been approved by |
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.
…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
This PR simplify the
describe_field
func in borrowck's diagnostics part, besides fix the FIXME in it.