Nothing Special   »   [go: up one dir, main page]

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: `exhaustive`
      --> src/main.rs:18:23
       |
    18 | #![cfg_attr(all(test, exhaustive), feature(non_exhaustive_omitted_patterns_lint))]
       |                       ^^^^^^^^^^
       |
       = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `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`, `ub_checks`, `unix`, `windows`
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(exhaustive)");` 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: `exhaustive`
      --> src/edit.rs:64:31
       |
    64 |         #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
       |                               ^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(exhaustive)");` 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 6, 2024
1 parent a713955 commit 554f072
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::path::PathBuf;

fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rustc-check-cfg=cfg(exhaustive)");

let prettyplease_version = match env::var("DEP_PRETTYPLEASE02_VERSION") {
Ok(prettyplease_version) => format!(r#"Some("{}")"#, prettyplease_version.escape_debug()),
Expand Down

0 comments on commit 554f072

Please sign in to comment.