-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
new lint: implied_bounds_in_impls
#11362
Conversation
r? @xFrednet (rustbot 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.
Really solid start. I love how you documented the steps in the implementation. There are a few nits, mostly related to documentation and the diagnostic messages, but then it should be ready to be merged. The logic itself looks good to me :)
Sorry, for the delay w
☔ The latest upstream changes (presumably #11373) made this pull request unmergeable. Please resolve the merge conflicts. |
fix compile error in doc example
implied_bounds_in_impl
implied_bounds_in_impls
LGTM, thank you for the new lint and swift update :) @bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Closes #10849
A new lint that looks for explicitly specified bounds that are already implied by other bounds in
impl Trait
return position types.One example, as shown in the linked example, would be
DerefMut<Target = T>
requiresDeref<Target = T>
to be wellformed, so specifyingDeref
there is unnecessary.This currently "ignores" (i.e., does not lint at all) transitive supertrait bounds (e.g.
trait A {} trait B: A {} trait C: B {}
, then having animpl A + C
type), because that seems a bit more difficult and I think this isn't technically a blocker. It leads to FNs, but shouldn't bring any FPschangelog: new lint [
implied_bounds_in_impls
]