Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cpufeatures] nightly warning: unexpected cfg condition value: `` #1136

Closed
DaniPopes opened this issue Nov 21, 2024 · 1 comment · Fixed by #1137
Closed

[cpufeatures] nightly warning: unexpected cfg condition value: `` #1136

DaniPopes opened this issue Nov 21, 2024 · 1 comment · Fixed by #1137

Comments

@DaniPopes
Copy link

cpufeatures::new!(cpuid_avx2, "avx2");

On nightly x86_64-unknown-linux-gnu + no rustflags generates:

warning: unexpected `cfg` condition value: ``
  --> src/arch/x86.rs:33:9
   |
33 |         cpufeatures::new!(cpuid_avx2, "avx2");
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = 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`, and `vita` and 6 more
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: this warning originates in the macro `$crate::__unless_target_features` which comes from the expansion of the macro `cpufeatures::new` (in Nightly builds, run with -Z macro-backtrace for more info)

Rust:

rustc 1.84.0-nightly (3fee0f12e 2024-11-20)
binary: rustc
commit-hash: 3fee0f12e4f595948f8f54f57c8b7a7a58127124
commit-date: 2024-11-20
host: x86_64-unknown-linux-gnu
release: 1.84.0-nightly
LLVM version: 19.1.3

Due to this line:

#[cfg(not(any(target_env = "sgx", target_os = "", target_os = "uefi")))]

@newpavlov
Copy link
Member

newpavlov commented Nov 21, 2024

Hm, I guess we should use none instead of an empty line?

UPD: Yeap, the x86_64-unknown-none spec uses the default value for target_os, i.e. none.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants