-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Compiler allows type aliases with unused lifetime parameters #35160
Comments
You can't misuse it because the checks are done on the semantic type, so it sees right through type aliases, e.g. |
@cybergeek94 You're not using it anywhere so it's actually ignored, apparently. Here's the error. |
I'm going to mark this is a diagnostics issue since it's likely an error centering on the type alias's definition site would be a lot more helpful here. |
Closing in favor of #35160. |
@Mark-Simulacrum you just closed this issue in favor of itself. |
Someone fix clipboards please; #41960. |
First noticed with this funky type alias, which probably needed a lifetime at one point but doesn't anymore.
Simplest case is the most trivial: create a type alias with a lifetime parameter, but don't use it on the RHS:
Playground
The linked example compiles on all three channels.
As far as I understand it, unused type parameters are always supposed to be hard errors, as established in RFC 738, so this must be a corner case that was never implemented, or otherwise a regression. I haven't tested previous releases, I might do that tomorrow if someone hasn't gotten to this already,
The text was updated successfully, but these errors were encountered: