-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Use named fields for {ast,hir}::ItemKind::Impl
#68204
Conversation
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
27fdce1
to
134692b
Compare
r? @oli-obk |
Seems fine to me; just make sure to use exhaustive matching where appropriate by enumerating the fields with |
polarity: _, | ||
defaultness: _, | ||
ref generics, | ||
ref of_trait, |
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.
Not sure what "of" signifies here. I would rename this to trait_ref
and let the type system speak to the Option<_>
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.
It's Some
if the item is an impl of a trait.
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.
But what does the f stand for? (I know what the field means.)
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.
"of" like the preposition. An impl of a trait.
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.
Oh. Well that was far from obvious. :) Given that you had to ELI5 it for me, could we change it to something else?
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 could, although to be honest I'm not enthusiastic about it. On a personal note, I have less time to contribute to open source this year, and having to spend some of it arguing over trivial choices like this has left me feeling a bit bummed out 😢.
edit: I'm aware that "arguing" requires two parties, so I'm partly responsible for using my time this way. I suppose I just don't see the value in this kind of extremely granular review.
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.
(Fwiw, I didn't think we were arguing -- I was just confused as to what it signified.)
@bors r+ |
📌 Commit 134692b904dcbb12ca8d15d96bba4c7ca487e4e3 has been approved by |
@bors r- oh overlooked the |
@bors r+ while i did stumble over |
📌 Commit 134692b904dcbb12ca8d15d96bba4c7ca487e4e3 has been approved by |
In case this bitrots, rebase and r=me with p=1 |
Rollup of 5 pull requests Successful merges: - #67780 (Move some queries from rustc::ty to librustc_ty.) - #68096 (Clean up some diagnostics by making them more consistent) - #68223 (Use 3.6 instead of 3.5 in float fract() documentation) - #68265 (Fix some issue numbers of unstable features) - #68266 (Changed docs for f32 and f64.) Failed merges: - #68204 (Use named fields for `{ast,hir}::ItemKind::Impl`) r? @ghost
☔ The latest upstream changes (presumably #68272) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors p=1 |
134692b
to
758860c
Compare
Your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
758860c
to
4743995
Compare
@bors r=oli-obk |
📌 Commit 4743995 has been approved by |
…i-obk Use named fields for `{ast,hir}::ItemKind::Impl` Currently, the widely used `ItemKind::Impl` variant is a tuple with seven fields. I want to add an eighth in rust-lang#68140, which means I have to update most matches on this variant anyways. Giving a name to each field improves readability and makes future changes of this nature much simpler. This change will cause several tools to break. I will fix them once this is merged.
Rollup of 9 pull requests Successful merges: - #66660 (Don't warn about snake case for field puns.) - #68093 (Fix deref impl typedef) - #68204 (Use named fields for `{ast,hir}::ItemKind::Impl`) - #68256 (Do not ICE on malformed suggestion spans) - #68279 (Clean up E0198 explanation) - #68291 (Update sanitizer tests) - #68312 (Add regression test for integer literals in generic arguments in where clauses) - #68314 (Stop treating `FalseEdges` and `FalseUnwind` as having semantic value for const eval) - #68317 (Clean up E0199 explanation) Failed merges: r? @ghost
`{ast,hir}::ItemKind::Impl` use named fields now
Rustup to rust-lang/rust#68204 changelog: none
Changes: ```` Downgrade range_plus_one to pedantic Rustup to rust-lang#68204 Add lifetimes to `LateLintPass` Fix rustc lint import paths generated by `new_lint` Add lint for default lint description Update documentation for adding new lints Generate new lints easily ````
submodules: update clippy from a8d90f6 to 7ae2442 Changes: ```` Downgrade range_plus_one to pedantic Rustup to #68204 Add lifetimes to `LateLintPass` Fix rustc lint import paths generated by `new_lint` Add lint for default lint description Update documentation for adding new lints Generate new lints easily ```` Fixes #68331
Changes: ```` Treat more strange pattern Split up `if_same_then_else` ui test Apply review comments Run `update_lints` Reduce span range Rename `ok_if_let` to `if_let_some_result` Apply review comments Add suggestion in `if_let_some_result` rustup rust-lang#67712 Allow `unused_self` lint at the function level Downgrade range_plus_one to pedantic Rustup to rust-lang#68204 Add lifetimes to `LateLintPass` Fix rustc lint import paths generated by `new_lint` Add lint for default lint description Update documentation for adding new lints Generate new lints easily Split up `booleans` ui test Fix the ordering on `nonminimal_bool` ````
submodules: update clippy from a8d90f6 to 7ae2442 Changes: ```` Downgrade range_plus_one to pedantic Rustup to #68204 Add lifetimes to `LateLintPass` Fix rustc lint import paths generated by `new_lint` Add lint for default lint description Update documentation for adding new lints Generate new lints easily ```` Fixes #68331
Changes: ```` Treat more strange pattern Split up `if_same_then_else` ui test Apply review comments Run `update_lints` Reduce span range Rename `ok_if_let` to `if_let_some_result` Apply review comments Add suggestion in `if_let_some_result` rustup rust-lang/rust#67712 Allow `unused_self` lint at the function level Downgrade range_plus_one to pedantic Rustup to rust-lang/rust#68204 Add lifetimes to `LateLintPass` Fix rustc lint import paths generated by `new_lint` Add lint for default lint description Update documentation for adding new lints Generate new lints easily Split up `booleans` ui test Fix the ordering on `nonminimal_bool` ````
Currently, the widely used
ItemKind::Impl
variant is a tuple with seven fields. I want to add an eighth in #68140, which means I have to update most matches on this variant anyways. Giving a name to each field improves readability and makes future changes of this nature much simpler.This change will cause several tools to break. I will fix them once this is merged.