Skip to content

Commit

Permalink
Quiet "unexpected cfg" for fbcode_build
Browse files Browse the repository at this point in the history
Summary:
Fixes:

    warning: unexpected `cfg` condition name: `fbcode_build`
      --> tests/common/mod.rs:18:12
       |
    18 | #[cfg_attr(fbcode_build, path = "fb/ci.rs")]
       |            ^^^^^^^^^^^^
       |
       = 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`, and `windows`
       = help: consider using a Cargo feature instead
       = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
                [lints.rust]
                unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fbcode_build)'] }
       = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(fbcode_build)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
       = note: `#[warn(unexpected_cfgs)]` on by default

Reviewed By: diliop

Differential Revision: D64017815

fbshipit-source-id: 95b61fdafd775bfa3e2de2542c2bec705ef1fb93
  • Loading branch information
zertosh authored and facebook-github-bot committed Oct 8, 2024
1 parent 56c68ec commit dc4742b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ nix = "0.25"
lto = true
codegen-units = 1
strip = true

[lints]
rust = { unexpected_cfgs = { check-cfg = ["cfg(fbcode_build)"], level = "warn" } }

0 comments on commit dc4742b

Please sign in to comment.