-
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.
Fix --check-cfg bug with args order when parsing
- Loading branch information
Showing
4 changed files
with
64 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
warning: unexpected `cfg` condition value | ||
--> $DIR/order-independant.rs:8:7 | ||
| | ||
LL | #[cfg(a)] | ||
| ^- help: specify a config value: `= "b"` | ||
| | ||
= note: expected values for `a` are: `b` | ||
= note: `#[warn(unexpected_cfgs)]` on by default | ||
|
||
warning: unexpected `cfg` condition value | ||
--> $DIR/order-independant.rs:12:7 | ||
| | ||
LL | #[cfg(a = "unk")] | ||
| ^^^^^^^^^ | ||
| | ||
= note: expected values for `a` are: `b` | ||
|
||
warning: 2 warnings emitted | ||
|
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
warning: unexpected `cfg` condition value | ||
--> $DIR/order-independant.rs:8:7 | ||
| | ||
LL | #[cfg(a)] | ||
| ^- help: specify a config value: `= "b"` | ||
| | ||
= note: expected values for `a` are: `b` | ||
= note: `#[warn(unexpected_cfgs)]` on by default | ||
|
||
warning: unexpected `cfg` condition value | ||
--> $DIR/order-independant.rs:12:7 | ||
| | ||
LL | #[cfg(a = "unk")] | ||
| ^^^^^^^^^ | ||
| | ||
= note: expected values for `a` are: `b` | ||
|
||
warning: 2 warnings emitted | ||
|
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// check-pass | ||
// revisions: names_before names_after | ||
// compile-flags: -Z unstable-options | ||
// compile-flags: --check-cfg=names(names_before,names_after) | ||
// [names_before]compile-flags: --check-cfg=names(a) --check-cfg=values(a,"b") | ||
// [names_after]compile-flags: --check-cfg=values(a,"b") --check-cfg=names(a) | ||
|
||
#[cfg(a)] | ||
//~^ WARNING unexpected `cfg` condition value | ||
fn my_cfg() {} | ||
|
||
#[cfg(a = "unk")] | ||
//~^ WARNING unexpected `cfg` condition value | ||
fn my_cfg() {} | ||
|
||
fn main() {} |