mirror of https://github.com/rust-lang/rust.git
Remove `feature` from the list of well known check-cfg name
This commit is contained in:
parent
0ff8610964
commit
9f15acec47
|
@ -1443,9 +1443,8 @@ impl CheckCfg {
|
||||||
let relocation_model_values = RelocModel::all();
|
let relocation_model_values = RelocModel::all();
|
||||||
|
|
||||||
// Unknown possible values:
|
// Unknown possible values:
|
||||||
// - `feature`
|
|
||||||
// - `target_feature`
|
// - `target_feature`
|
||||||
for name in [sym::feature, sym::target_feature] {
|
for name in [sym::target_feature] {
|
||||||
self.expecteds.entry(name).or_insert(ExpectedValues::Any);
|
self.expecteds.entry(name).or_insert(ExpectedValues::Any);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `FALSE`
|
||||||
LL | #[cfg(FALSE)]
|
LL | #[cfg(FALSE)]
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
|
|
||||||
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `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`
|
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `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`
|
||||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||||
|
|
||||||
warning: 1 warning emitted
|
warning: 1 warning emitted
|
||||||
|
|
|
@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `target_architecture`
|
||||||
LL | #[cfg(target(os = "linux", architecture = "arm"))]
|
LL | #[cfg(target(os = "linux", architecture = "arm"))]
|
||||||
| ^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `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`
|
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `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`
|
||||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||||
|
|
||||||
warning: 1 warning emitted
|
warning: 1 warning emitted
|
||||||
|
|
|
@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `unknown_key`
|
||||||
LL | #[cfg(unknown_key = "value")]
|
LL | #[cfg(unknown_key = "value")]
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `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`
|
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `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`
|
||||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: `value`
|
warning: unexpected `cfg` condition value: `value`
|
||||||
|
@ -17,5 +17,17 @@ LL | #[cfg(test = "value")]
|
||||||
|
|
|
|
||||||
= note: no expected value for `test`
|
= note: no expected value for `test`
|
||||||
|
|
||||||
warning: 2 warnings emitted
|
warning: unexpected `cfg` condition name: `feature`
|
||||||
|
--> $DIR/exhaustive-names-values.rs:19:7
|
||||||
|
|
|
||||||
|
LL | #[cfg(feature = "unk")]
|
||||||
|
| ^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
warning: unexpected `cfg` condition name: `feature`
|
||||||
|
--> $DIR/exhaustive-names-values.rs:26:7
|
||||||
|
|
|
||||||
|
LL | #[cfg(feature = "std")]
|
||||||
|
| ^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
warning: 4 warnings emitted
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `unknown_key`
|
||||||
LL | #[cfg(unknown_key = "value")]
|
LL | #[cfg(unknown_key = "value")]
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `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`
|
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `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`
|
||||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: `value`
|
warning: unexpected `cfg` condition value: `value`
|
||||||
|
@ -17,5 +17,17 @@ LL | #[cfg(test = "value")]
|
||||||
|
|
|
|
||||||
= note: no expected value for `test`
|
= note: no expected value for `test`
|
||||||
|
|
||||||
warning: 2 warnings emitted
|
warning: unexpected `cfg` condition name: `feature`
|
||||||
|
--> $DIR/exhaustive-names-values.rs:19:7
|
||||||
|
|
|
||||||
|
LL | #[cfg(feature = "unk")]
|
||||||
|
| ^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
warning: unexpected `cfg` condition name: `feature`
|
||||||
|
--> $DIR/exhaustive-names-values.rs:26:7
|
||||||
|
|
|
||||||
|
LL | #[cfg(feature = "std")]
|
||||||
|
| ^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
warning: 4 warnings emitted
|
||||||
|
|
||||||
|
|
|
@ -17,11 +17,15 @@ pub fn f() {}
|
||||||
pub fn f() {}
|
pub fn f() {}
|
||||||
|
|
||||||
#[cfg(feature = "unk")]
|
#[cfg(feature = "unk")]
|
||||||
//[feature]~^ WARNING unexpected `cfg` condition value
|
//[empty_names_values]~^ WARNING unexpected `cfg` condition name
|
||||||
//[full]~^^ WARNING unexpected `cfg` condition value
|
//[empty_cfg]~^^ WARNING unexpected `cfg` condition name
|
||||||
|
//[feature]~^^^ WARNING unexpected `cfg` condition value
|
||||||
|
//[full]~^^^^ WARNING unexpected `cfg` condition value
|
||||||
pub fn feat() {}
|
pub fn feat() {}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
|
//[empty_names_values]~^ WARNING unexpected `cfg` condition name
|
||||||
|
//[empty_cfg]~^^ WARNING unexpected `cfg` condition name
|
||||||
pub fn feat() {}
|
pub fn feat() {}
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
|
|
|
@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `unknown_key`
|
||||||
LL | #[cfg(unknown_key = "value")]
|
LL | #[cfg(unknown_key = "value")]
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `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`
|
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `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`
|
||||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||||
|
|
||||||
warning: 1 warning emitted
|
warning: 1 warning emitted
|
||||||
|
|
|
@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `unknown_key`
|
||||||
LL | #[cfg(unknown_key = "value")]
|
LL | #[cfg(unknown_key = "value")]
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `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`
|
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `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`
|
||||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||||
|
|
||||||
warning: 1 warning emitted
|
warning: 1 warning emitted
|
||||||
|
|
|
@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `crossbeam_loom`
|
||||||
LL | #[cfg(crossbeam_loom)]
|
LL | #[cfg(crossbeam_loom)]
|
||||||
| ^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `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`
|
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `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`
|
||||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||||
|
|
||||||
warning: 1 warning emitted
|
warning: 1 warning emitted
|
||||||
|
|
|
@ -15,6 +15,7 @@ fn target_os() {}
|
||||||
fn feature_misspell() {}
|
fn feature_misspell() {}
|
||||||
|
|
||||||
#[cfg(feature = "foo")]
|
#[cfg(feature = "foo")]
|
||||||
|
//~^ WARNING unexpected `cfg` condition name
|
||||||
fn feature() {}
|
fn feature() {}
|
||||||
|
|
||||||
#[cfg(uniw)]
|
#[cfg(uniw)]
|
||||||
|
|
|
@ -14,15 +14,21 @@ warning: unexpected `cfg` condition name: `features`
|
||||||
--> $DIR/well-known-names.rs:13:7
|
--> $DIR/well-known-names.rs:13:7
|
||||||
|
|
|
|
||||||
LL | #[cfg(features = "foo")]
|
LL | #[cfg(features = "foo")]
|
||||||
| --------^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
| |
|
|
|
||||||
| help: there is a config with a similar name: `feature`
|
= help: expected names are: `debug_assertions`, `doc`, `doctest`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `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`
|
||||||
|
|
||||||
|
warning: unexpected `cfg` condition name: `feature`
|
||||||
|
--> $DIR/well-known-names.rs:17:7
|
||||||
|
|
|
||||||
|
LL | #[cfg(feature = "foo")]
|
||||||
|
| ^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
warning: unexpected `cfg` condition name: `uniw`
|
warning: unexpected `cfg` condition name: `uniw`
|
||||||
--> $DIR/well-known-names.rs:20:7
|
--> $DIR/well-known-names.rs:21:7
|
||||||
|
|
|
|
||||||
LL | #[cfg(uniw)]
|
LL | #[cfg(uniw)]
|
||||||
| ^^^^ help: there is a config with a similar name: `unix`
|
| ^^^^ help: there is a config with a similar name: `unix`
|
||||||
|
|
||||||
warning: 3 warnings emitted
|
warning: 4 warnings emitted
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue