-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #94561 - Urgau:check-cfg-lint-help-remove, r=petrochenkov
Improve unexpected_cfgs lint when their is no value expected This pull-request improve the `unexpected_cfgs` when their is no value expected by suggesting to remove the value. I also took the liberty to special case it for `feature` as it seems wrong to suggest to remove the value when the problem is most probably the absence of value(s) and also the fact that it doesn't make sense to only have `feature` without a value. r? `@petrochenkov`
- Loading branch information
Showing
7 changed files
with
52 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
// Check that we detect unexpected value when none are allowed | ||
// | ||
// check-pass | ||
// compile-flags: --check-cfg=values(feature) -Z unstable-options | ||
// compile-flags: --check-cfg=values(test) --check-cfg=values(feature) -Z unstable-options | ||
|
||
#[cfg(feature = "foo")] | ||
//~^ WARNING unexpected `cfg` condition value | ||
fn do_foo() {} | ||
|
||
#[cfg(test = "foo")] | ||
//~^ WARNING unexpected `cfg` condition value | ||
fn do_foo() {} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters