-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Remove uses of cfg({any()/all()})
#149791
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
Conversation
|
Some changes occurred in check-cfg diagnostics cc @Urgau Some changes occurred in compiler/rustc_attr_parsing |
|
r? @chenyukang rustbot has assigned @chenyukang. Use |
This comment has been minimized.
This comment has been minimized.
d418aea to
cb5acfc
Compare
|
r? jdonszelmann |
|
Can you split-off the As for the warning it should probably be a lint (so it can be enabled and disabled), but either way the warning will need to go through T-lang first, with a nomination and maybe a crater run. |
cb5acfc to
cf79ee7
Compare
|
With my T-lang hat on, this seems reasonable. Nominating for discussion of the new lint. |
This comment has been minimized.
This comment has been minimized.
|
Running into the above error where (@__items ($($not:meta,)*) ; ( ($($m:meta),*) ($($tokens:tt)*) ), $($rest:tt)*) => {
#[cfg(all($($m,)* not(any($($not),*))))] cfg_if! { @__identity $($tokens)* }
cfg_if! { @__items ($($not,)* $($m,)*) ; $($rest)* }
};is invoked with no |
cf79ee7 to
06d836b
Compare
|
This PR modifies Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
|
Implemented as a pre-expansion early lint |
This comment has been minimized.
This comment has been minimized.
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.
Though I'm not T-lang, I agree with josh that this is a good lint to add. Just got some comments about the implementation but nothing too major. Just gotta clean some things up :)
|
@bors r- |
|
sorry, I do think it's good to change these tests, but could you point me to a test that still tests |
|
oh I found it myself, ok my bad |
…elmann
Remove uses of `cfg({any()/all()})`
~~This implements the followup warning suggested in rust-lang/rfcs#3695
~~Lint against an empty `cfg(any/all)`, suggest the boolean literal equivalents.~~
rust-lang#149791 (comment)
Tracking issue: rust-lang#131204
Suggest `cfg(false)` instead of `cfg(FALSE)` Split from rust-lang#149791 cc `@Urgau`
…elmann
Remove uses of `cfg({any()/all()})`
~~This implements the followup warning suggested in rust-lang/rfcs#3695
~~Lint against an empty `cfg(any/all)`, suggest the boolean literal equivalents.~~
rust-lang#149791 (comment)
Tracking issue: rust-lang#131204
Suggest `cfg(false)` instead of `cfg(FALSE)` Split from rust-lang#149791 cc ``@Urgau``
…elmann
Remove uses of `cfg({any()/all()})`
~~This implements the followup warning suggested in rust-lang/rfcs#3695
~~Lint against an empty `cfg(any/all)`, suggest the boolean literal equivalents.~~
rust-lang#149791 (comment)
Tracking issue: rust-lang#131204
Suggest `cfg(false)` instead of `cfg(FALSE)` Split from rust-lang#149791 cc ```@Urgau```
Suggest `cfg(false)` instead of `cfg(FALSE)` Split from rust-lang#149791 cc ````@Urgau````
…elmann
Remove uses of `cfg({any()/all()})`
~~This implements the followup warning suggested in rust-lang/rfcs#3695
~~Lint against an empty `cfg(any/all)`, suggest the boolean literal equivalents.~~
rust-lang#149791 (comment)
Tracking issue: rust-lang#131204
Suggest `cfg(false)` instead of `cfg(FALSE)` Split from rust-lang#149791 cc `````@Urgau`````
…elmann
Remove uses of `cfg({any()/all()})`
~~This implements the followup warning suggested in rust-lang/rfcs#3695
~~Lint against an empty `cfg(any/all)`, suggest the boolean literal equivalents.~~
rust-lang#149791 (comment)
Tracking issue: rust-lang#131204
Suggest `cfg(false)` instead of `cfg(FALSE)` Split from rust-lang#149791 cc ```````@Urgau```````
Rollup of 7 pull requests Successful merges: - #149655 (bootstrap: add rustc-dev install target) - #149789 (Cleanup in the attribute parsers) - #149791 (Remove uses of `cfg({any()/all()})`) - #149792 (Suggest `cfg(false)` instead of `cfg(FALSE)`) - #149883 (add regression test for `proc_macro` error subdiagnostics) - #149884 (Clippy subtree update) - #149896 (Add myself(makai410) to the review rotation) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #149791 - clubby789:cfg-bool-lints, r=jdonszelmann Remove uses of `cfg({any()/all()})` ~~This implements the followup warning suggested in rust-lang/rfcs#3695 ~~Lint against an empty `cfg(any/all)`, suggest the boolean literal equivalents.~~ #149791 (comment) Tracking issue: #131204
This implements the followup warning suggested in rust-lang/rfcs#3695Lint against an emptycfg(any/all), suggest the boolean literal equivalents.#149791 (comment)
Tracking issue: #131204