New lints: More precise trait lints that take advantage of sealed trait analysis #973
Labels
A-lint
Area: new or existing lint
E-help-wanted
Call for participation: Help is requested to fix this issue.
E-mentor
Call for participation: Mentorship is available for this issue.
At least three of our current lints were written before we could reliably determine if a trait was sealed or not. This means their queries are insufficiently precise, and can cause false-positives in cases where the trait is sealed.
In each case, we should update the existing lint to represent the "non-sealed" case, and add a new lint for the "sealed" case. The exact change required is slightly different in each case, so I'm linking to the corresponding descriptions in each case. Let's make each checkbox a separate PR:
trait_method_missing
sealed_trait_method_missing
lint for the sealed casetrait_removed_associated_constant
sealed_trait_removed_associated_constant
lint for the sealed casetrait_removed_associated_type
sealed_trait_removed_associated_type
lint for the sealed caseIn the sealed case, the breakage is associated with using the removed item. In the non-sealed case, the breakage is implementing the trait (if the removed item is hidden) and using the item (if not hidden).
Make sure to check out our contributing guide, and take a look at what prior lints' merged PRs looked like so you know what to expect. It's easier than you think!
The text was updated successfully, but these errors were encountered: