Skip to content

Compile error with stdarch_x86_avx512 feature not enable #1550

Closed
@serendipity-crypto

Description

@serendipity-crypto

When I compile my codes with rand v0.9.0-beta.1 and a computer has avx512, the compiler return following error. It seems like that the attribute #![feature(stdarch_x86_avx512)] is not enabled correctly in rand.

   Compiling rand_chacha v0.9.0-beta.1
   Compiling rand v0.9.0-beta.1
error[E0658]: use of unstable library feature `stdarch_x86_avx512`
   --> E:\packages\rust\cargo\registry\src\rsproxy.cn-e3de039b2554c837\rand-0.9.0-beta.1\src\distr\utils.rs:183:39
    |
183 |                     let hi = unsafe { $mulhi(self.into(), x.into()) }.into();
    |                                       ^
...
196 |     wmul_impl_16! { u16x32, _mm512_mulhi_epu16, _mm512_mullo_epi16 }
    |     ---------------------------------------------------------------- in this macro invocation
    |
    = note: see issue #111137 <https://github.com/rust-lang/rust/issues/111137> for more information
    = help: add `#![feature(stdarch_x86_avx512)]` to the crate attributes to enable
    = note: this compiler was built on 2025-01-12; consider upgrading it if it is out of date
    = note: this error originates in the macro `wmul_impl_16` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: use of unstable library feature `stdarch_x86_avx512`
   --> E:\packages\rust\cargo\registry\src\rsproxy.cn-e3de039b2554c837\rand-0.9.0-beta.1\src\distr\utils.rs:184:39
    |
184 |                     let lo = unsafe { $mullo(self.into(), x.into()) }.into();
    |                                       ^
...
196 |     wmul_impl_16! { u16x32, _mm512_mulhi_epu16, _mm512_mullo_epi16 }
    |     ---------------------------------------------------------------- in this macro invocation
    |
    = note: see issue #111137 <https://github.com/rust-lang/rust/issues/111137> for more information
    = help: add `#![feature(stdarch_x86_avx512)]` to the crate attributes to enable
    = note: this compiler was built on 2025-01-12; consider upgrading it if it is out of date
    = note: this error originates in the macro `wmul_impl_16` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0658`.
error: could not compile `rand` (lib) due to 2 previous errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions