-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Traits allow unused generic parameters #37496
Comments
Bear with me if I sound bitter, because I am. No one other than @steveklabnik closed #25871 last February. I will not close this issue, because I am better than him. |
@sanxiyn that issue was closed as part of a blanket policy on lints, it wasn't anything personal. If this issue were "we should make a lint for this", I wouldn't have made it in the first place. Furthermore, I didn't close your PR at all. it was closed due to a lack of activity by alex. This issue is "I'm not even sure this code should be valid." If it is, then this should be closed, just as that issue was closed. |
I don't see why this should not be valid - for example, marker traits have an unused Self by this standard. |
@arielb1 would it? Marker traits don't take any generic parameters. Is it that Self is treated as one or something? |
It was implemented as a lint because unused generic parameters, in general, is not an error. An example is _assert_error_is_sync_send in libstd. I think it is a legitimate use case. That said, maybe unused lifetime parameters, or unused generic parameters in traits, are useless. I can easily rebase my PR restricted to these cases. |
Sure enough. |
They're not useless, they can have semantic implications, for example |
|
Consider this trait:
rustc
will happily let this compile, even though'a
is never used for anything. The same goes for type parameters. This feels incorrect to me, though I might be wrong.The text was updated successfully, but these errors were encountered: