Skip to content

fix: refine feature flag conditions for Arc and Rc implementations to include target_has_atomic checks #2924

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zouguangxian
Copy link

This PR enables building serde for the riscv32im-unknown-none-elf target.

cargo build -p serde --no-default-features --features="rc,alloc" --target riscv32im-unknown-none-elf

… include target_has_atomic checks

This commit enables building serde for the `riscv32im-unknown-none-elf` target.

`cargo build -p serde --no-default-features --features="rc,alloc" --target riscv32im-unknown-none-elf`
@zouguangxian
Copy link
Author

zouguangxian commented May 16, 2025

target_has_atomic was an unstable feature for 1.56.0.

error[E0658]: `cfg(target_has_atomic)` is experimental and subject to change
   --> serde/src/ser/impls.rs:521:55
    |
521 |     #[cfg(any(feature = "std", all(feature = "alloc", target_has_atomic = "ptr")))]
    |                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #3[29](https://github.com/serde-rs/serde/actions/runs/15034267458/job/42253004053?pr=2924#step:7:30)76 <https://github.com/rust-lang/rust/issues/32976> for more information

For more information about this error, try `rustc --explain E0658`.
error: could not compile `serde` due to previous error
Error: Process completed with exit code 101.

@dtolnay, can you give some suggestions about this feature?

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

Successfully merging this pull request may close these issues.

1 participant