Skip to content

Commit 7bb6f2f

Browse files
committed
Resolve unexpected_cfgs warning
warning: unexpected `cfg` condition name: `trybuild_no_target` --> src/cargo.rs:200:13 | 200 | if cfg!(trybuild_no_target) { | ^^^^^^^^^^^^^^^^^^ | = 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(trybuild_no_target)");` 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
1 parent 59ef19a commit 7bb6f2f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ use std::path::Path;
66
fn main() -> io::Result<()> {
77
println!("cargo:rerun-if-changed=src/tests");
88

9+
println!("cargo:rustc-check-cfg=cfg(trybuild_no_target)");
10+
911
let out_dir = env::var_os("OUT_DIR").unwrap();
1012
let target = env::var("TARGET").ok();
1113
let path = Path::new(&out_dir).join("target");

0 commit comments

Comments
 (0)