1
Fork 0

Auto merge of #135059 - matthiaskrgr:rollup-0ka9o3h, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #131729 (Make the `test` cfg a userspace check-cfg)
 - #134241 (more concrete source url of std docs [V2])
 - #135042 (taint fcx on selection errors during unsizing)
 - #135049 (Remove unused fields from RepeatElementCopy obligation)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2025-01-03 09:34:23 +00:00
commit 319f5292a1
45 changed files with 200 additions and 106 deletions

View file

@ -666,7 +666,12 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
// Dyn-compatibility violations or miscellaneous. // Dyn-compatibility violations or miscellaneous.
Err(err) => { Err(err) => {
self.err_ctxt().report_selection_error(obligation.clone(), &obligation, &err); let guar = self.err_ctxt().report_selection_error(
obligation.clone(),
&obligation,
&err,
);
self.fcx.set_tainted_by_errors(guar);
// Treat this like an obligation and follow through // Treat this like an obligation and follow through
// with the unsizing - the lack of a coercion should // with the unsizing - the lack of a coercion should
// be silent, as it causes a type mismatch later. // be silent, as it causes a type mismatch later.

View file

@ -1907,21 +1907,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}; };
let lang_item = self.tcx.require_lang_item(LangItem::Copy, None); let lang_item = self.tcx.require_lang_item(LangItem::Copy, None);
let code = traits::ObligationCauseCode::RepeatElementCopy { let code =
is_constable, traits::ObligationCauseCode::RepeatElementCopy { is_constable, elt_span: element.span };
elt_type: element_ty,
elt_span: element.span,
elt_stmt_span: self
.tcx
.hir()
.parent_iter(element.hir_id)
.find_map(|(_, node)| match node {
hir::Node::Item(it) => Some(it.span),
hir::Node::Stmt(stmt) => Some(stmt.span),
_ => None,
})
.expect("array repeat expressions must be inside an item or statement"),
};
self.require_type_meets(element_ty, element.span, code, lang_item); self.require_type_meets(element_ty, element.span, code, lang_item);
} }

View file

@ -247,11 +247,11 @@ pub enum ObligationCauseCode<'tcx> {
/// If element is a `const fn` or const ctor we display a help message suggesting /// If element is a `const fn` or const ctor we display a help message suggesting
/// to move it to a new `const` item while saying that `T` doesn't implement `Copy`. /// to move it to a new `const` item while saying that `T` doesn't implement `Copy`.
is_constable: IsConstable, is_constable: IsConstable,
elt_type: Ty<'tcx>,
/// Span of the repeat element.
///
/// This is used to suggest wrapping it in a `const { ... }` block.
elt_span: Span, elt_span: Span,
/// Span of the statement/item in which the repeat expression occurs. We can use this to
/// place a `const` declaration before it
elt_stmt_span: Span,
}, },
/// Types of fields (other than the last, except for packed structs) in a struct must be sized. /// Types of fields (other than the last, except for packed structs) in a struct must be sized.

View file

@ -332,6 +332,11 @@ impl CheckCfg {
// Note that symbols inserted conditionally in `default_configuration` // Note that symbols inserted conditionally in `default_configuration`
// are inserted unconditionally here. // are inserted unconditionally here.
// //
// One exception is the `test` cfg which is consider to be a "user-space"
// cfg, despite being also set by in `default_configuration` above.
// It allows the build system to "deny" using the config by not marking it
// as expected (e.g. `lib.test = false` for Cargo).
//
// When adding a new config here you should also update // When adding a new config here you should also update
// `tests/ui/check-cfg/well-known-values.rs` (in order to test the // `tests/ui/check-cfg/well-known-values.rs` (in order to test the
// expected values of the new config) and bless the all directory. // expected values of the new config) and bless the all directory.
@ -453,8 +458,6 @@ impl CheckCfg {
ins!(sym::target_thread_local, no_values); ins!(sym::target_thread_local, no_values);
ins!(sym::test, no_values);
ins!(sym::ub_checks, no_values); ins!(sym::ub_checks, no_values);
ins!(sym::unix, no_values); ins!(sym::unix, no_values);

View file

@ -2966,12 +2966,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
"required for the cast from `{source}` to `{target}`", "required for the cast from `{source}` to `{target}`",
))); )));
} }
ObligationCauseCode::RepeatElementCopy { ObligationCauseCode::RepeatElementCopy { is_constable, elt_span } => {
is_constable,
elt_type: _,
elt_span,
elt_stmt_span: _,
} => {
err.note( err.note(
"the `Copy` trait is required because this value will be copied for each element of the array", "the `Copy` trait is required because this value will be copied for each element of the array",
); );

View file

@ -89,7 +89,7 @@
//! Check out the Rust contribution guidelines [here]( //! Check out the Rust contribution guidelines [here](
//! https://rustc-dev-guide.rust-lang.org/contributing.html#writing-documentation). //! https://rustc-dev-guide.rust-lang.org/contributing.html#writing-documentation).
//! The source for this documentation can be found on //! The source for this documentation can be found on
//! [GitHub](https://github.com/rust-lang/rust). //! [GitHub](https://github.com/rust-lang/rust) in the 'library/std/' directory.
//! To contribute changes, make sure you read the guidelines first, then submit //! To contribute changes, make sure you read the guidelines first, then submit
//! pull-requests for your suggested changes. //! pull-requests for your suggested changes.
//! //!

View file

@ -624,6 +624,8 @@ impl Builder<'_> {
// get warnings about it being unexpected. // get warnings about it being unexpected.
hostflags.arg("-Zunstable-options"); hostflags.arg("-Zunstable-options");
hostflags.arg("--check-cfg=cfg(bootstrap)"); hostflags.arg("--check-cfg=cfg(bootstrap)");
// #[cfg(bootstrap)] as we are transition `test` to userspace cfg
hostflags.arg("--check-cfg=cfg(test)");
// FIXME: It might be better to use the same value for both `RUSTFLAGS` and `RUSTDOCFLAGS`, // FIXME: It might be better to use the same value for both `RUSTFLAGS` and `RUSTDOCFLAGS`,
// but this breaks CI. At the very least, stage0 `rustdoc` needs `--cfg bootstrap`. See // but this breaks CI. At the very least, stage0 `rustdoc` needs `--cfg bootstrap`. See

View file

@ -77,6 +77,8 @@ const LLD_FILE_NAMES: &[&str] = &["ld.lld", "ld64.lld", "lld-link", "wasm-ld"];
#[allow(clippy::type_complexity)] // It's fine for hard-coded list and type is explained above. #[allow(clippy::type_complexity)] // It's fine for hard-coded list and type is explained above.
const EXTRA_CHECK_CFGS: &[(Option<Mode>, &str, Option<&[&'static str]>)] = &[ const EXTRA_CHECK_CFGS: &[(Option<Mode>, &str, Option<&[&'static str]>)] = &[
(None, "bootstrap", None), (None, "bootstrap", None),
// #[cfg(bootstrap)] to be removed when Cargo is updated
(None, "test", None),
(Some(Mode::Rustc), "llvm_enzyme", None), (Some(Mode::Rustc), "llvm_enzyme", None),
(Some(Mode::Codegen), "llvm_enzyme", None), (Some(Mode::Codegen), "llvm_enzyme", None),
(Some(Mode::ToolRustc), "llvm_enzyme", None), (Some(Mode::ToolRustc), "llvm_enzyme", None),

View file

@ -99,7 +99,7 @@ the need to specify them manually.
Well known names and values are implicitly added as long as at least one `--check-cfg` argument Well known names and values are implicitly added as long as at least one `--check-cfg` argument
is present. is present.
As of `2024-08-20T`, the list of known names is as follows: As of `2025-01-02T`, the list of known names is as follows:
<!--- See CheckCfg::fill_well_known in compiler/rustc_session/src/config.rs --> <!--- See CheckCfg::fill_well_known in compiler/rustc_session/src/config.rs -->
@ -130,11 +130,13 @@ As of `2024-08-20T`, the list of known names is as follows:
- `target_pointer_width` - `target_pointer_width`
- `target_thread_local` - `target_thread_local`
- `target_vendor` - `target_vendor`
- `test`
- `ub_checks` - `ub_checks`
- `unix` - `unix`
- `windows` - `windows`
> Starting with CURRENT_RUSTC_VERSION, the `test` cfg is consider to be a "userspace" config
> despite being also set by `rustc` and should be managed by the build-system it-self.
Like with `values(any())`, well known names checking can be disabled by passing `cfg(any())` Like with `values(any())`, well known names checking can be disabled by passing `cfg(any())`
as argument to `--check-cfg`. as argument to `--check-cfg`.

View file

@ -506,8 +506,9 @@ impl<'test> TestCx<'test> {
// Generate `cfg(FALSE, REV1, ..., REVN)` (for all possible revisions) // Generate `cfg(FALSE, REV1, ..., REVN)` (for all possible revisions)
// //
// For compatibility reason we consider the `FALSE` cfg to be expected // For compatibility reason we consider the `FALSE` cfg to be expected
// since it is extensively used in the testsuite. // since it is extensively used in the testsuite, as well as the `test`
check_cfg.push_str("cfg(FALSE"); // cfg since we have tests that uses it.
check_cfg.push_str("cfg(test,FALSE");
for revision in &self.props.revisions { for revision in &self.props.revisions {
check_cfg.push(','); check_cfg.push(',');
check_cfg.push_str(&normalize_revision(revision)); check_cfg.push_str(&normalize_revision(revision));

View file

@ -1,13 +0,0 @@
//@ known-bug: #130521
#![feature(dyn_compatible_for_dispatch)]
struct Vtable(dyn Cap<'static>);
trait Cap<'a> {}
union Transmute {
t: u128,
u: &'static Vtable,
}
const G: &Copy = unsafe { Transmute { t: 1 }.u };

View file

@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `FALSE`
LL | #[cfg(FALSE)] LL | #[cfg(FALSE)]
| ^^^^^ | ^^^^^
| |
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows` = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
= help: to expect this configuration use `--check-cfg=cfg(FALSE)` = help: to expect this configuration use `--check-cfg=cfg(FALSE)`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = 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 = note: `#[warn(unexpected_cfgs)]` on by default

View file

@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `has_foo`
LL | #[cfg(has_foo)] LL | #[cfg(has_foo)]
| ^^^^^^^ | ^^^^^^^
| |
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `has_bar`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows` = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `has_bar`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
= help: consider using a Cargo feature instead = help: consider using a Cargo feature instead
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint: = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
[lints.rust] [lints.rust]

View file

@ -25,7 +25,7 @@ warning: unexpected `cfg` condition name: `tokio_unstable`
LL | #[cfg(tokio_unstable)] LL | #[cfg(tokio_unstable)]
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
| |
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows` = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
= help: consider using a Cargo feature instead = help: consider using a Cargo feature instead
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint: = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
[lints.rust] [lints.rust]

View file

@ -25,7 +25,7 @@ warning: unexpected `cfg` condition name: `tokio_unstable`
LL | #[cfg(tokio_unstable)] LL | #[cfg(tokio_unstable)]
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
| |
= help: expected names are: `CONFIG_NVME`, `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows` = help: expected names are: `CONFIG_NVME`, `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
= help: consider using a Cargo feature instead = help: consider using a Cargo feature instead
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint: = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
[lints.rust] [lints.rust]

View file

@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `value`
LL | #[cfg(value)] LL | #[cfg(value)]
| ^^^^^ | ^^^^^
| |
= help: expected names are: `bar`, `bee`, `clippy`, `cow`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `foo`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows` = help: expected names are: `bar`, `bee`, `clippy`, `cow`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `foo`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
= help: to expect this configuration use `--check-cfg=cfg(value)` = help: to expect this configuration use `--check-cfg=cfg(value)`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = 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 = note: `#[warn(unexpected_cfgs)]` on by default

View file

@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `my_value`
LL | #[cfg(my_value)] LL | #[cfg(my_value)]
| ^^^^^^^^ | ^^^^^^^^
| |
= help: expected names are: `bar`, `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `foo`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows` = help: expected names are: `bar`, `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `foo`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
= help: to expect this configuration use `--check-cfg=cfg(my_value)` = help: to expect this configuration use `--check-cfg=cfg(my_value)`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = 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 = note: `#[warn(unexpected_cfgs)]` on by default

View file

@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `linux`
LL | #[cfg(linux)] LL | #[cfg(linux)]
| ^^^^^ help: found config with similar value: `target_os = "linux"` | ^^^^^ help: found config with similar value: `target_os = "linux"`
| |
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows` = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
= help: to expect this configuration use `--check-cfg=cfg(linux)` = help: to expect this configuration use `--check-cfg=cfg(linux)`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = 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 = note: `#[warn(unexpected_cfgs)]` on by default

View file

@ -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: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows` = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
= help: to expect this configuration use `--check-cfg=cfg(target_architecture, values("arm"))` = help: to expect this configuration use `--check-cfg=cfg(target_architecture, values("arm"))`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = 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 = note: `#[warn(unexpected_cfgs)]` on by default

View file

@ -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: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows` = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
= help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))` = help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = 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 = note: `#[warn(unexpected_cfgs)]` on by default
@ -12,12 +12,10 @@ LL | #[cfg(unknown_key = "value")]
warning: unexpected `cfg` condition value: `value` warning: unexpected `cfg` condition value: `value`
--> $DIR/exhaustive-names-values.rs:14:7 --> $DIR/exhaustive-names-values.rs:14:7
| |
LL | #[cfg(test = "value")] LL | #[cfg(target_vendor = "value")]
| ^^^^---------- | ^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: remove the value
| |
= note: no expected value for `test` = note: expected values for `target_vendor` are: `apple`, `espressif`, `fortanix`, `ibm`, `kmc`, `nintendo`, `nvidia`, `pc`, `risc0`, `sony`, `sun`, `unikraft`, `unknown`, `uwp`, `win7`, and `wrs`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
warning: unexpected `cfg` condition name: `feature` warning: unexpected `cfg` condition name: `feature`

View file

@ -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: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows` = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
= help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))` = help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = 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 = note: `#[warn(unexpected_cfgs)]` on by default
@ -12,12 +12,10 @@ LL | #[cfg(unknown_key = "value")]
warning: unexpected `cfg` condition value: `value` warning: unexpected `cfg` condition value: `value`
--> $DIR/exhaustive-names-values.rs:14:7 --> $DIR/exhaustive-names-values.rs:14:7
| |
LL | #[cfg(test = "value")] LL | #[cfg(target_vendor = "value")]
| ^^^^---------- | ^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: remove the value
| |
= note: no expected value for `test` = note: expected values for `target_vendor` are: `apple`, `espressif`, `fortanix`, `ibm`, `kmc`, `nintendo`, `nvidia`, `pc`, `risc0`, `sony`, `sun`, `unikraft`, `unknown`, `uwp`, `win7`, and `wrs`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
warning: unexpected `cfg` condition value: `unk` warning: unexpected `cfg` condition value: `unk`

View file

@ -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: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows` = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
= help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))` = help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = 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 = note: `#[warn(unexpected_cfgs)]` on by default
@ -12,12 +12,10 @@ LL | #[cfg(unknown_key = "value")]
warning: unexpected `cfg` condition value: `value` warning: unexpected `cfg` condition value: `value`
--> $DIR/exhaustive-names-values.rs:14:7 --> $DIR/exhaustive-names-values.rs:14:7
| |
LL | #[cfg(test = "value")] LL | #[cfg(target_vendor = "value")]
| ^^^^---------- | ^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: remove the value
| |
= note: no expected value for `test` = note: expected values for `target_vendor` are: `apple`, `espressif`, `fortanix`, `ibm`, `kmc`, `nintendo`, `nvidia`, `pc`, `risc0`, `sony`, `sun`, `unikraft`, `unknown`, `uwp`, `win7`, and `wrs`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
warning: unexpected `cfg` condition value: `unk` warning: unexpected `cfg` condition value: `unk`

View file

@ -11,7 +11,7 @@
//~^ WARNING unexpected `cfg` condition name //~^ WARNING unexpected `cfg` condition name
pub fn f() {} pub fn f() {}
#[cfg(test = "value")] #[cfg(target_vendor = "value")]
//~^ WARNING unexpected `cfg` condition value //~^ WARNING unexpected `cfg` condition value
pub fn f() {} pub fn f() {}

View file

@ -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: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows` = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
= help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))` = help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = 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 = note: `#[warn(unexpected_cfgs)]` on by default

View file

@ -1,12 +1,12 @@
warning: unexpected `cfg` condition value: `value` warning: unexpected `cfg` condition value: `value`
--> $DIR/exhaustive-values.rs:9:7 --> $DIR/exhaustive-values.rs:9:7
| |
LL | #[cfg(test = "value")] LL | #[cfg(unix = "value")]
| ^^^^---------- | ^^^^----------
| | | |
| help: remove the value | help: remove the value
| |
= note: no expected value for `test` = note: no expected value for `unix`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = 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 = note: `#[warn(unexpected_cfgs)]` on by default

View file

@ -6,7 +6,7 @@
//@ [empty_cfg]compile-flags: --check-cfg=cfg() //@ [empty_cfg]compile-flags: --check-cfg=cfg()
//@ [without_names]compile-flags: --check-cfg=cfg(any()) //@ [without_names]compile-flags: --check-cfg=cfg(any())
#[cfg(test = "value")] #[cfg(unix = "value")]
//~^ WARNING unexpected `cfg` condition value //~^ WARNING unexpected `cfg` condition value
pub fn f() {} pub fn f() {}

View file

@ -1,12 +1,12 @@
warning: unexpected `cfg` condition value: `value` warning: unexpected `cfg` condition value: `value`
--> $DIR/exhaustive-values.rs:9:7 --> $DIR/exhaustive-values.rs:9:7
| |
LL | #[cfg(test = "value")] LL | #[cfg(unix = "value")]
| ^^^^---------- | ^^^^----------
| | | |
| help: remove the value | help: remove the value
| |
= note: no expected value for `test` = note: no expected value for `unix`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = 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 = note: `#[warn(unexpected_cfgs)]` on by default

View file

@ -29,7 +29,7 @@ fn use_bar() {}
//~^ WARNING unexpected `cfg` condition value //~^ WARNING unexpected `cfg` condition value
fn use_zebra() {} fn use_zebra() {}
#[cfg_attr(uu, test)] #[cfg_attr(uu, unix)]
//~^ WARNING unexpected `cfg` condition name //~^ WARNING unexpected `cfg` condition name
fn do_test() {} fn do_test() {}

View file

@ -41,10 +41,10 @@ LL | #[cfg(feature = "zebra")]
warning: unexpected `cfg` condition name: `uu` warning: unexpected `cfg` condition name: `uu`
--> $DIR/mix.rs:32:12 --> $DIR/mix.rs:32:12
| |
LL | #[cfg_attr(uu, test)] LL | #[cfg_attr(uu, unix)]
| ^^ | ^^
| |
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows` = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
= help: to expect this configuration use `--check-cfg=cfg(uu)` = help: to expect this configuration use `--check-cfg=cfg(uu)`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration

View file

@ -20,6 +20,7 @@ LL | #[cfg(test = "foo")]
| help: remove the value | help: remove the value
| |
= note: no expected value for `test` = note: no expected value for `test`
= help: to expect this configuration use `--check-cfg=cfg(test, values("foo"))`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
warning: 2 warnings emitted warning: 2 warnings emitted

View file

@ -20,6 +20,7 @@ LL | #[cfg(test = "foo")]
| help: remove the value | help: remove the value
| |
= note: no expected value for `test` = note: no expected value for `test`
= help: to expect this configuration use `--check-cfg=cfg(test, values("foo"))`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
warning: 2 warnings emitted warning: 2 warnings emitted

View file

@ -20,6 +20,7 @@ LL | #[cfg(test = "foo")]
| help: remove the value | help: remove the value
| |
= note: no expected value for `test` = note: no expected value for `test`
= help: to expect this configuration use `--check-cfg=cfg(test, values("foo"))`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
warning: 2 warnings emitted warning: 2 warnings emitted

View file

@ -14,7 +14,7 @@ warning: unexpected `cfg` condition name: `r#false`
LL | #[cfg(r#false)] LL | #[cfg(r#false)]
| ^^^^^^^ | ^^^^^^^
| |
= help: expected names are: `async`, `clippy`, `debug_assertions`, `doc`, `doctest`, `edition2015`, `edition2021`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `r#true`, `ub_checks`, `unix`, and `windows` = help: expected names are: `async`, `clippy`, `debug_assertions`, `doc`, `doctest`, `edition2015`, `edition2021`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `r#true`, `ub_checks`, `unix`, and `windows`
= help: to expect this configuration use `--check-cfg=cfg(r#false)` = help: to expect this configuration use `--check-cfg=cfg(r#false)`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration

View file

@ -14,7 +14,7 @@ warning: unexpected `cfg` condition name: `r#false`
LL | #[cfg(r#false)] LL | #[cfg(r#false)]
| ^^^^^^^ | ^^^^^^^
| |
= help: expected names are: `r#async`, `clippy`, `debug_assertions`, `doc`, `doctest`, `edition2015`, `edition2021`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `r#true`, `ub_checks`, `unix`, and `windows` = help: expected names are: `r#async`, `clippy`, `debug_assertions`, `doc`, `doctest`, `edition2015`, `edition2021`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `r#true`, `ub_checks`, `unix`, and `windows`
= help: to expect this configuration use `--check-cfg=cfg(r#false)` = help: to expect this configuration use `--check-cfg=cfg(r#false)`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration

View file

@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `my_lib_cfg`
LL | cfg_macro::my_lib_macro!(); LL | cfg_macro::my_lib_macro!();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows` = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
= note: using a cfg inside a macro will use the cfgs from the destination crate and not the ones from the defining crate = note: using a cfg inside a macro will use the cfgs from the destination crate and not the ones from the defining crate
= help: try referring to `cfg_macro::my_lib_macro` crate for guidance on how handle this unexpected cfg = help: try referring to `cfg_macro::my_lib_macro` crate for guidance on how handle this unexpected cfg
= help: the macro `cfg_macro::my_lib_macro` may come from an old version of the `cfg_macro` crate, try updating your dependency with `cargo update -p cfg_macro` = help: the macro `cfg_macro::my_lib_macro` may come from an old version of the `cfg_macro` crate, try updating your dependency with `cargo update -p cfg_macro`

View file

@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `my_lib_cfg`
LL | cfg_macro::my_lib_macro!(); LL | cfg_macro::my_lib_macro!();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows` = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
= note: using a cfg inside a macro will use the cfgs from the destination crate and not the ones from the defining crate = note: using a cfg inside a macro will use the cfgs from the destination crate and not the ones from the defining crate
= help: try referring to `cfg_macro::my_lib_macro` crate for guidance on how handle this unexpected cfg = help: try referring to `cfg_macro::my_lib_macro` crate for guidance on how handle this unexpected cfg
= help: to expect this configuration use `--check-cfg=cfg(my_lib_cfg)` = help: to expect this configuration use `--check-cfg=cfg(my_lib_cfg)`

View file

@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `crossbeam_loom`
LL | #[cfg(crossbeam_loom)] LL | #[cfg(crossbeam_loom)]
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
| |
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows` = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
= help: to expect this configuration use `--check-cfg=cfg(crossbeam_loom)` = help: to expect this configuration use `--check-cfg=cfg(crossbeam_loom)`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = 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 = note: `#[warn(unexpected_cfgs)]` on by default

View file

@ -8,6 +8,9 @@
//~^ WARNING unexpected `cfg` condition name //~^ WARNING unexpected `cfg` condition name
pub fn f() {} pub fn f() {}
#[cfg(test)]
//~^ WARNING unexpected `cfg` condition name
#[cfg(windows)] #[cfg(windows)]
pub fn g() {} pub fn g() {}

View file

@ -8,5 +8,15 @@ LL | #[cfg(widnows)]
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = 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 = note: `#[warn(unexpected_cfgs)]` on by default
warning: 1 warning emitted warning: unexpected `cfg` condition name: `test`
--> $DIR/unexpected-cfg-name.rs:11:7
|
LL | #[cfg(test)]
| ^^^^
|
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
= help: to expect this configuration use `--check-cfg=cfg(test)`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
warning: 2 warnings emitted

View file

@ -18,7 +18,7 @@ warning: unexpected `cfg` condition name: `features`
LL | #[cfg(features = "foo")] LL | #[cfg(features = "foo")]
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
| |
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows` = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `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`, `ub_checks`, `unix`, and `windows`
= help: to expect this configuration use `--check-cfg=cfg(features, values("foo"))` = help: to expect this configuration use `--check-cfg=cfg(features, values("foo"))`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration

View file

@ -76,8 +76,6 @@
//~^ WARN unexpected `cfg` condition value //~^ WARN unexpected `cfg` condition value
target_vendor = "_UNEXPECTED_VALUE", target_vendor = "_UNEXPECTED_VALUE",
//~^ WARN unexpected `cfg` condition value //~^ WARN unexpected `cfg` condition value
test = "_UNEXPECTED_VALUE",
//~^ WARN unexpected `cfg` condition value
ub_checks = "_UNEXPECTED_VALUE", ub_checks = "_UNEXPECTED_VALUE",
//~^ WARN unexpected `cfg` condition value //~^ WARN unexpected `cfg` condition value
unix = "_UNEXPECTED_VALUE", unix = "_UNEXPECTED_VALUE",

View file

@ -236,17 +236,6 @@ LL | target_vendor = "_UNEXPECTED_VALUE",
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
--> $DIR/well-known-values.rs:79:5 --> $DIR/well-known-values.rs:79:5
| |
LL | test = "_UNEXPECTED_VALUE",
| ^^^^----------------------
| |
| help: remove the value
|
= note: no expected value for `test`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
--> $DIR/well-known-values.rs:81:5
|
LL | ub_checks = "_UNEXPECTED_VALUE", LL | ub_checks = "_UNEXPECTED_VALUE",
| ^^^^^^^^^---------------------- | ^^^^^^^^^----------------------
| | | |
@ -256,7 +245,7 @@ LL | ub_checks = "_UNEXPECTED_VALUE",
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
--> $DIR/well-known-values.rs:83:5 --> $DIR/well-known-values.rs:81:5
| |
LL | unix = "_UNEXPECTED_VALUE", LL | unix = "_UNEXPECTED_VALUE",
| ^^^^---------------------- | ^^^^----------------------
@ -267,7 +256,7 @@ LL | unix = "_UNEXPECTED_VALUE",
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
--> $DIR/well-known-values.rs:85:5 --> $DIR/well-known-values.rs:83:5
| |
LL | windows = "_UNEXPECTED_VALUE", LL | windows = "_UNEXPECTED_VALUE",
| ^^^^^^^---------------------- | ^^^^^^^----------------------
@ -278,7 +267,7 @@ LL | windows = "_UNEXPECTED_VALUE",
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
warning: unexpected `cfg` condition value: `linuz` warning: unexpected `cfg` condition value: `linuz`
--> $DIR/well-known-values.rs:91:7 --> $DIR/well-known-values.rs:89:7
| |
LL | #[cfg(target_os = "linuz")] // testing that we suggest `linux` LL | #[cfg(target_os = "linuz")] // testing that we suggest `linux`
| ^^^^^^^^^^^^------- | ^^^^^^^^^^^^-------
@ -288,5 +277,5 @@ LL | #[cfg(target_os = "linuz")] // testing that we suggest `linux`
= note: expected values for `target_os` are: `aix`, `android`, `cuda`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `macos`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `redox`, `rtems`, `solaris`, `solid_asp3`, `teeos`, `trusty`, `tvos`, `uefi`, `unknown`, `visionos`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous`, and `zkvm` = note: expected values for `target_os` are: `aix`, `android`, `cuda`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `macos`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `redox`, `rtems`, `solaris`, `solid_asp3`, `teeos`, `trusty`, `tvos`, `uefi`, `unknown`, `visionos`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous`, and `zkvm`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
warning: 29 warnings emitted warning: 28 warnings emitted

View file

@ -0,0 +1,71 @@
error[E0038]: the trait `Qux` cannot be made into an object
--> $DIR/taint-const-eval.rs:11:15
|
LL | static FOO: &(dyn Qux + Sync) = "desc";
| ^^^^^^^^^^^^^^ `Qux` cannot be made into an object
|
note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
--> $DIR/taint-const-eval.rs:8:8
|
LL | trait Qux {
| --- this trait cannot be made into an object...
LL | fn bar();
| ^^^ ...because associated function `bar` has no `self` parameter
help: consider turning `bar` into a method by giving it a `&self` argument
|
LL | fn bar(&self);
| +++++
help: alternatively, consider constraining `bar` so it does not apply to trait objects
|
LL | fn bar() where Self: Sized;
| +++++++++++++++++
error[E0038]: the trait `Qux` cannot be made into an object
--> $DIR/taint-const-eval.rs:11:33
|
LL | static FOO: &(dyn Qux + Sync) = "desc";
| ^^^^^^ `Qux` cannot be made into an object
|
note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
--> $DIR/taint-const-eval.rs:8:8
|
LL | trait Qux {
| --- this trait cannot be made into an object...
LL | fn bar();
| ^^^ ...because associated function `bar` has no `self` parameter
= note: required for the cast from `&'static str` to `&'static (dyn Qux + Sync + 'static)`
help: consider turning `bar` into a method by giving it a `&self` argument
|
LL | fn bar(&self);
| +++++
help: alternatively, consider constraining `bar` so it does not apply to trait objects
|
LL | fn bar() where Self: Sized;
| +++++++++++++++++
error[E0038]: the trait `Qux` cannot be made into an object
--> $DIR/taint-const-eval.rs:11:15
|
LL | static FOO: &(dyn Qux + Sync) = "desc";
| ^^^^^^^^^^^^^^ `Qux` cannot be made into an object
|
note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
--> $DIR/taint-const-eval.rs:8:8
|
LL | trait Qux {
| --- this trait cannot be made into an object...
LL | fn bar();
| ^^^ ...because associated function `bar` has no `self` parameter
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
help: consider turning `bar` into a method by giving it a `&self` argument
|
LL | fn bar(&self);
| +++++
help: alternatively, consider constraining `bar` so it does not apply to trait objects
|
LL | fn bar() where Self: Sized;
| +++++++++++++++++
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0038`.

View file

@ -0,0 +1,26 @@
error[E0038]: the trait `Qux` cannot be made into an object
--> $DIR/taint-const-eval.rs:11:33
|
LL | static FOO: &(dyn Qux + Sync) = "desc";
| ^^^^^^ `Qux` cannot be made into an object
|
note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
--> $DIR/taint-const-eval.rs:8:8
|
LL | trait Qux {
| --- this trait cannot be made into an object...
LL | fn bar();
| ^^^ ...because associated function `bar` has no `self` parameter
= note: required for the cast from `&'static str` to `&'static (dyn Qux + Sync + 'static)`
help: consider turning `bar` into a method by giving it a `&self` argument
|
LL | fn bar(&self);
| +++++
help: alternatively, consider constraining `bar` so it does not apply to trait objects
|
LL | fn bar() where Self: Sized;
| +++++++++++++++++
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0038`.

View file

@ -0,0 +1,16 @@
// Test that we do not attempt to create dyn-incompatible trait objects in const eval.
//@ revisions: curr dyn_compatible_for_dispatch
#![cfg_attr(dyn_compatible_for_dispatch, feature(dyn_compatible_for_dispatch))]
trait Qux {
fn bar();
}
static FOO: &(dyn Qux + Sync) = "desc";
//~^ the trait `Qux` cannot be made into an object
//[curr]~| the trait `Qux` cannot be made into an object
//[curr]~| the trait `Qux` cannot be made into an object
fn main() {}