Skip to content
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

Consider making shadowing of type/lifetime parameters a lint #489

Open
nrc opened this issue Nov 29, 2014 · 3 comments
Open

Consider making shadowing of type/lifetime parameters a lint #489

nrc opened this issue Nov 29, 2014 · 3 comments
Labels
postponed RFCs that have been postponed and may be revisited at a later time. T-lang Relevant to the language team, which will review and decide on the RFC.

Comments

@nrc
Copy link
Member

nrc commented Nov 29, 2014

see #459

We accepted this RFC as a hard error, but it should probably be a configurable lint.

@nrc nrc added the postponed RFCs that have been postponed and may be revisited at a later time. label Nov 29, 2014
@ftxqxd
Copy link
Contributor

ftxqxd commented Nov 29, 2014

This would be significantly less useful as a normal lint, because lints run after type checking and so on, and most problems caused by lifetime/type parameter shadowing give errors before the lints can run. It would probably have to be a different kind of lint that runs before type checking to be useful, and as far as I know we don’t have such a category of lints at the moment.

@nrc
Copy link
Member Author

nrc commented Nov 29, 2014

@P1start yeah, we discussed this in the meeting and that is why it is accepted as a hard error. In order to make this a lint, we need to improve the lint infrastructure to allow lints to run before type checking.

@ghost
Copy link

ghost commented Dec 3, 2014

I would argue that lints running after typeck is not the only concern around making shadowing a lint and not a hard error. If, for instance, we empirically determine that shadowing type/lifetime params is not intended in, say, 90% of code that inhibits it, then there's little value in it being a lint and some potential cost: lints do not stop compilation, therefore typeck errors emerging from an unintended shadowing could obscure the lint and thus make reading the compiler output more difficult.

@nrc nrc added the T-lang Relevant to the language team, which will review and decide on the RFC. label May 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
postponed RFCs that have been postponed and may be revisited at a later time. T-lang Relevant to the language team, which will review and decide on the RFC.
Projects
None yet
Development

No branches or pull requests

2 participants