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

Cannot compile on nightly-2022-01-13 - target_has_atomic is experimental #2356

Closed
koxu1996 opened this issue Jan 2, 2023 · 1 comment
Closed

Comments

@koxu1996
Copy link

koxu1996 commented Jan 2, 2023

Problem description

I was trying to use serde package with nightly-2022-01-13 toolchain, but I got compilation errors like the following one:

   Compiling serde v1.0.152
error[E0658]: `cfg(target_has_atomic)` is experimental and subject to change
   --> /home/koxu1996/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.152/src/lib.rs:258:59
    |
258 |     #[cfg(all(feature = "std", not(no_target_has_atomic), target_has_atomic = "8"))]
    |                                                           ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #32976 <https://github.com/rust-lang/rust/issues/32976> for more information
    = help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable

I am aware this is outdated nightly toolchain, but should we expect some compatibility here 🤔? If not, please close the issue.

Reproducing

  1. Create simple project with serde:
➜  cargo new app --bin && cd ./app
     Created binary (application) `app` package
➜  cargo add serde
    Updating crates.io index
      Adding serde v1.0.152 to dependencies.
             Features:
             + std
             - alloc
             - derive
             - rc
             - serde_derive
             - unstable
➜  cargo build
  1. Switch to nightly-2022-01-13 toolchain:
➜  rustup default nightly-2022-01-13

info: using existing install for 'nightly-2022-01-13-x86_64-unknown-linux-gnu'
info: default toolchain set to 'nightly-2022-01-13-x86_64-unknown-linux-gnu'

  nightly-2022-01-13-x86_64-unknown-linux-gnu unchanged - rustc 1.60.0-nightly (1bd4fdc94 2022-01-12)
  1. Build:
➜  cargo build

Workaround

Use nightly-2022-04-07 toolchain or serde <= 1.0.149 (before #2337).

@dtolnay
Copy link
Member

dtolnay commented Jan 2, 2023

Old nightly toolchains are not supported. The expectation if you are using nightly is that you are updating every night, or only using crate versions from the same time frame as the nightly.

@dtolnay dtolnay closed this as completed Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants