Skip to content

Commit ca243e7

Browse files
committed
add testcase for more than 3 cfg names
1 parent 0213c87 commit ca243e7

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// #120427
2+
// This test checks we won't suggest more than 3 span suggestions for cfg names
3+
//
4+
// check-pass
5+
// compile-flags: -Z unstable-options
6+
// compile-flags: --check-cfg=cfg(foo,values("value")) --check-cfg=cfg(bar,values("value")) --check-cfg=cfg(bee,values("value")) --check-cfg=cfg(cow,values("value"))
7+
8+
#[cfg(value)]
9+
//~^ WARNING unexpected `cfg` condition name: `value`
10+
fn x() {}
11+
12+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
warning: unexpected `cfg` condition name: `value`
2+
--> $DIR/cfg-value-for-cfg-name-duplicate.rs:8:7
3+
|
4+
LL | #[cfg(value)]
5+
| ^^^^^
6+
|
7+
= help: expected names are: `bar`, `bee`, `cow`, `debug_assertions`, `doc`, `doctest`, `foo`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows`
8+
= help: to expect this configuration use `--check-cfg=cfg(value)`
9+
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
10+
= note: `#[warn(unexpected_cfgs)]` on by default
11+
12+
warning: 1 warning emitted
13+

0 commit comments

Comments
 (0)