Skip to content

Commit

Permalink
Resolve unexpected_cfgs warning
Browse files Browse the repository at this point in the history
    warning: unexpected `cfg` condition name: `error_generic_member_access`
       --> src/lib.rs:238:13
        |
    238 | #![cfg_attr(error_generic_member_access, feature(error_generic_member_access))]
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `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`, `windows`
        = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(error_generic_member_access)");` to the top of the `build.rs`
        = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
        = note: `#[warn(unexpected_cfgs)]` on by default

    warning: unexpected `cfg` condition name: `thiserror_nightly_testing`
       --> src/lib.rs:240:11
        |
    240 | #[cfg(all(thiserror_nightly_testing, not(error_generic_member_access)))]
        |           ^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(thiserror_nightly_testing)");` to the top of the `build.rs`
        = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `error_generic_member_access`
       --> src/lib.rs:240:42
        |
    240 | #[cfg(all(thiserror_nightly_testing, not(error_generic_member_access)))]
        |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(error_generic_member_access)");` to the top of the `build.rs`
        = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `error_generic_member_access`
       --> src/lib.rs:245:7
        |
    245 | #[cfg(error_generic_member_access)]
        |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(error_generic_member_access)");` to the top of the `build.rs`
        = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `error_generic_member_access`
       --> src/lib.rs:257:11
        |
    257 |     #[cfg(error_generic_member_access)]
        |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(error_generic_member_access)");` to the top of the `build.rs`
        = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `thiserror_nightly_testing`
     --> tests/test_option.rs:1:13
      |
    1 | #![cfg_attr(thiserror_nightly_testing, feature(error_generic_member_access))]
      |             ^^^^^^^^^^^^^^^^^^^^^^^^^
      |
      = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `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`, `windows`
      = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(thiserror_nightly_testing)");` to the top of the `build.rs`
      = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
      = note: `#[warn(unexpected_cfgs)]` on by default

    warning: unexpected `cfg` condition name: `thiserror_nightly_testing`
     --> tests/test_option.rs:3:7
      |
    3 | #[cfg(thiserror_nightly_testing)]
      |       ^^^^^^^^^^^^^^^^^^^^^^^^^
      |
      = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(thiserror_nightly_testing)");` to the top of the `build.rs`
      = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `thiserror_nightly_testing`
      --> tests/test_option.rs:48:7
       |
    48 | #[cfg(thiserror_nightly_testing)]
       |       ^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(thiserror_nightly_testing)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `thiserror_nightly_testing`
     --> tests/test_backtrace.rs:1:13
      |
    1 | #![cfg_attr(thiserror_nightly_testing, feature(error_generic_member_access))]
      |             ^^^^^^^^^^^^^^^^^^^^^^^^^
      |
      = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `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`, `windows`
      = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(thiserror_nightly_testing)");` to the top of the `build.rs`
      = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
      = note: `#[warn(unexpected_cfgs)]` on by default

    warning: unexpected `cfg` condition name: `thiserror_nightly_testing`
       --> tests/test_option.rs:104:16
        |
    104 | #[cfg_attr(not(thiserror_nightly_testing), ignore)]
        |                ^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(thiserror_nightly_testing)");` to the top of the `build.rs`
        = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `thiserror_nightly_testing`
     --> tests/test_backtrace.rs:9:7
      |
    9 | #[cfg(thiserror_nightly_testing)]
      |       ^^^^^^^^^^^^^^^^^^^^^^^^^
      |
      = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(thiserror_nightly_testing)");` to the top of the `build.rs`
      = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `thiserror_nightly_testing`
      --> tests/test_backtrace.rs:16:7
       |
    16 | #[cfg(thiserror_nightly_testing)]
       |       ^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(thiserror_nightly_testing)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `thiserror_nightly_testing`
       --> tests/test_backtrace.rs:150:7
        |
    150 | #[cfg(thiserror_nightly_testing)]
        |       ^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(thiserror_nightly_testing)");` to the top of the `build.rs`
        = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `thiserror_nightly_testing`
       --> tests/test_backtrace.rs:273:16
        |
    273 | #[cfg_attr(not(thiserror_nightly_testing), ignore)]
        |                ^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(thiserror_nightly_testing)");` to the top of the `build.rs`
        = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
  • Loading branch information
dtolnay committed May 7, 2024
1 parent e7ad85e commit cf43d0c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build.rs
Expand Up @@ -7,6 +7,9 @@ use std::process::{self, Command, Stdio};
fn main() {
println!("cargo:rerun-if-changed=build/probe.rs");

println!("cargo:rustc-check-cfg=cfg(error_generic_member_access)");
println!("cargo:rustc-check-cfg=cfg(thiserror_nightly_testing)");

let error_generic_member_access;
let consider_rustc_bootstrap;
if compile_probe(false) {
Expand Down

0 comments on commit cf43d0c

Please sign in to comment.