-
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.
Add specific test for check-cfg "and X more" diagnostic
- Loading branch information
Showing
4 changed files
with
26 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// This test makes sure that we don't emit a long list of possible values | ||
// but that we stop at a fix point and say "and X more". | ||
// | ||
//@ check-pass | ||
//@ no-auto-check-cfg | ||
//@ compile-flags: --check-cfg=cfg() | ||
//@ normalize-stderr-test: "and \d+ more" -> "and X more" | ||
//@ normalize-stderr-test: "`[a-zA-Z0-9_-]+`" -> "`xxx`" | ||
|
||
fn main() { | ||
cfg!(target_feature = "zebra"); | ||
//~^ WARNING unexpected `cfg` condition value | ||
} |
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,12 @@ | ||
warning: unexpected `xxx` condition value: `xxx` | ||
--> $DIR/and-more-diagnostic.rs:11:10 | ||
| | ||
LL | cfg!(target_feature = "zebra"); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: expected values for `xxx` are: `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, `xxx`, and `xxx` and X more | ||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration | ||
= note: `#[warn(unexpected_cfgs)]` on by default | ||
|
||
warning: 1 warning 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
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