error[E0635]: unknown feature `stdsimd`

rustc (current):

❯ rustc --version
rustc 1.78.0-nightly (256b6fb19 2024-02-06)

issue:
I updated nightly yesterday (w/ clean and update) and am getting the following build error across all of my nightly projects coming from various deps:

error[E0635]: unknown feature `stdsimd`
...
23 | #![cfg_attr(nightly, feature(stdsimd))]

I've tried reverting several days in nightly (w/ clean and update) and still get the error.

What else can I try to get around it?

The stdsimd feature got removed two days ago:

have you tried going back to a nightly version that was released before the merge?

5 Likes

You must upgrade ahash to 0.8.

Use cargo tree -i ahash to identify what needs to be upgraded.

The old version made wrong assumptions about unstable rust features.

4 Likes

I meet this error too, and fix it by switch to older verison:

rustup install 1.76.0
rustup default nightly-2024-02-04
3 Likes

Sorry for the late response, i did try going back about 10 days in nightly (while cleaning and updating) and was still seeing the error pop up, but this should have worked. Still unsure why--I'll chalk it up to user error! :man_shrugging: Thanks for your help!

1 Like

yes this was it--along with several other outdated packages using stdsimd. Thanks for your help!

I had tried this initially to no avail. I'll chalk it up to user error! most of my projects started on nightly, but were now able to be swapped to stable. For the rest of them, updating the problem deps (or forking and manually removing the stdsimd feature) fixed it for me, though reverting to a prior release of nightly should have worked. Thanks for your help!

Worked for me. Thanks!

update to >= 0.8.9
[[package]]

name = "ahash"

version = "0.8.9"

source = "registry+https://github.com/rust-lang/crates.io-index"

checksum = "d713b3834d76b85304d4d525563c1276e2e30dc97cc67bfb4585a4a29fc2c89f"

dependencies = [

"cfg-if",

"getrandom",

"once_cell",

"version_check",

"zerocopy",

]

You may have 2 versions of ahash in your Cargo.lock file. This can be confirmed by running $ cargo tree -i ahash. In my case, I had 0.7.x & 0.8.x. So, it worked following this steps below:

  1. Remove your Cargo.lock file or you can just remove either of the versions (preferably older).
  2. Clean the target/ folder using $ cargo clean.
  3. Build again $ cargo build.

It will work.

2 Likes
cargo update --recursive -v --color always 

Solved this problem for me after writing the code at work and then it breaking at my home office.

it worked for me, thanks!