-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Refactor rustc_on_unimplemented's filter parser #140307
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
base: master
Are you sure you want to change the base?
Conversation
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
574e113
to
b2db974
Compare
r? compiler |
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.
Generally looks ok, a bunch of nitpicks below.
compiler/rustc_trait_selection/src/error_reporting/traits/on_unimplemented_condition.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_trait_selection/src/error_reporting/traits/on_unimplemented_condition.rs
Outdated
Show resolved
Hide resolved
span: Span, | ||
}, | ||
#[diag(trait_selection_rustc_on_unimplemented_on_clause_literal, code = E0232)] | ||
UnSupportedLiteral { |
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.
s/UnSupported/Unsupported/
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.
Also, the variant name doesn't really match the message name: "unsupported" vs "unimplemented". It would be better if they were close to each other. Likewise for a couple of the other variants.
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 not sure what you mean. The unimplemented
in the flt name references the name of the attribute, not what went wrong. But I have edited it to ...unsupported_literal_in_on
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.
Maybe consider having trait_selection_rou_*
rather than trait_selection_rustc_on_unimplemented_*
? I errored on the side of not abbreviating.
Followup to #139091; I plan on moving most of this code into
rustc_attr_parsing
at some point, but want to land this separately first.I have taken care to preserve the original behavior as much as I could:
InvalidFlag
variant is new, this PR turns this (from being ignored and silently doing nothing) into an error:Finally, this gets rid of the "longest" dependency in rustc:
