How to enable unstable nightly features used by dependency?

I am compiling a which compiles this dependency (with rust 1.77 nightly)

─❯ cargo run generate -h
   Compiling curve25519-dalek v4.1.2
error[E0658]: use of unstable library feature 'stdsimd'
  --> /home/nixos/.cargo/registry/src/
26 |     _mm256_madd52lo_epu64(z.into(), x.into(), y.into()).into()
   |     ^^^^^^^^^^^^^^^^^^^^^
   = note: see issue #48556 <> for more information
   = help: add `#![feature(stdsimd)]` to the crate attributes to enable
   = note: this compiler was built on 2024-01-31; consider upgrading it if it is out of dat

where should I add the #![feature(stdsimd)] ? Because in it doesnt work?

Could you try upgrading your nightly toolchain? stdsimd got removed a few days ago, I assume your dependency has already removed it, making it incompatible with your current nightly version.


Upgrading to 1.78 ?, where can I find the nightly channels or releases?

I have the following toolchain file:

channel = "nightly"
components = [ "rustfmt", "rust-analyzer", "miri", "rust-docs", "clippy", "rust-src"]
profile = "default"

Nightly is released each night (hence the name). rustup update nightly should install yesterday's nightly release.

1 Like

yeah sorry dump question: but who knows.

channel = "nightly-2024-02-09"
components = [ "rustfmt", "rust-analyzer", "miri", "rust-docs", "clippy", "rust-src"]
profile = "default"

works now.

But how can the library compile suddenly when the function was removed?

Because the 1.78.0-2024-02-09 compiler doesn't require #![feature(stdsimd)] to be present at the top of the crate root file in order for the crate to be able to call the _mm256_madd52lo_epu64 instruction, whereas your old compiler needed it. In fact, since stdsimd got removed, your new compiler doesn't even know that there was ever a nightly feature called stdsimd. So vice versa, if your new compiler encounters a #![feature(stdsimd)] somewhere (i.e. in a dependency that hasn't been updated yet), it will throw an error too, because it doesn't know stdsimd.