-
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
We should forbid type parameters from shadowing other types #21301
Comments
Nominating for reasons of backwards-incompatibility. |
(Though adding a lint would be back-compat, aiui) |
I for one am not convinced we should disallow this. We disallow type parameters from shadowing one another specifically because it came up very frequently. This seems less likely to arise frequently (it relies on not following our suggested naming conventions for type parameters and modules, for one thing). |
(Even if it did come up frequently, I'd probably rather just work on the error messages that result.) |
This issue has been moved to the RFCs repo: rust-lang/rfcs#707 |
This is a weird case that we should probably not allow:
The rule appears to be that the
<T: Trait>
has precedence over the module, it would be easiest if we just errored out in this circumstance.The text was updated successfully, but these errors were encountered: