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

Use of unknown feature gates should be a deny-by-default lint #60456

Open
jethrogb opened this issue May 1, 2019 · 2 comments
Open

Use of unknown feature gates should be a deny-by-default lint #60456

jethrogb opened this issue May 1, 2019 · 2 comments
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@jethrogb
Copy link
Contributor

jethrogb commented May 1, 2019

#52644 made it an error to specify a #![feature(...)] that the compiler doesn't know about. It could be a deny-by-default lint instead. @varkor in #52644 (comment):

I don't see a strong reason not to make the unknown feature error a deny-by-default lint instead, which would allow you to silence it.

@Centril
Copy link
Contributor

Centril commented May 1, 2019

I think this should be a warning instead which makes it more feasible to actually garbage collect old feature gates.

@Centril Centril added A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. T-lang Relevant to the language team, which will review and decide on the PR/issue. labels May 1, 2019
@tmandry
Copy link
Member

tmandry commented May 12, 2021

This is really important for doing soft migrations across compiler versions. For instance:

  1. An existing feature foo is used in the code base
  2. That feature gets split into foo and min_foo
  3. The codebase owner has no way of atomically updating the compiler and code at the same time

In this case you'd need #![allow(unknown_features)], so you can also add #![feature(min_foo)] before updating the compiler and completing the migration.

@tmandry tmandry added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants