-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add clippy into the known cfg
list
#121137
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
Changes from all commits
0860fc1
33e9fc5
4085421
533e3f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1435,12 +1435,16 @@ impl CheckCfg { | |||||||||||||||||
// | ||||||||||||||||||
// When adding a new config here you should also update | ||||||||||||||||||
// `tests/ui/check-cfg/well-known-values.rs`. | ||||||||||||||||||
// | ||||||||||||||||||
// Don't forget to update `src/doc/unstable-book/src/compiler-flags/check-cfg.md` | ||||||||||||||||||
// in the unstable book as well! | ||||||||||||||||||
|
||||||||||||||||||
ins!(sym::debug_assertions, no_values); | ||||||||||||||||||
|
||||||||||||||||||
// These three are never set by rustc, but we set them anyway: they | ||||||||||||||||||
// should not trigger a lint because `cargo doc`, `cargo test`, and | ||||||||||||||||||
// `cargo miri run` (respectively) can set them. | ||||||||||||||||||
// These four are never set by rustc, but we set them anyway: they | ||||||||||||||||||
// should not trigger a lint because `cargo clippy`, `cargo doc`, | ||||||||||||||||||
// `cargo test` and `cargo miri run` (respectively) can set them. | ||||||||||||||||||
ins!(sym::clippy, no_values); | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The check-cfg section of the unstable book also needs updating: rust/src/doc/unstable-book/src/compiler-flags/check-cfg.md Lines 80 to 87 in 4ae1e79
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code here should have a comment mentioning the docs :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding it. |
||||||||||||||||||
ins!(sym::doc, no_values); | ||||||||||||||||||
ins!(sym::doctest, no_values); | ||||||||||||||||||
ins!(sym::miri, no_values); | ||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,10 +77,11 @@ Those well known names and values follows the same stability as what they refer | |
Well known names and values checking is always enabled as long as at least one | ||
`--check-cfg` argument is present. | ||
|
||
As of `2024-01-09T`, the list of known names is as follows: | ||
As of `2024-02-15T`, the list of known names is as follows: | ||
|
||
<!--- See CheckCfg::fill_well_known in compiler/rustc_session/src/config.rs --> | ||
|
||
- `clippy` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be great if you could also update the date above to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
- `debug_assertions` | ||
- `doc` | ||
- `doctest` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs to be added in tests/ui/check-cfg/well-known-values.rs.
You will also probably need to bless the directory