Skip to content

Commit ee2bd76

Browse files
authored
Only add implementation for Arc if the target supports it (#70)
* Only add implementation for `Arc` if the target supports it * Test target without atomic ptr in CI * Run `cargo check` for target without atomic ptr * Don't enable glam feature for thumbv6m-none-eabi target
1 parent 1604d52 commit ee2bd76

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

.github/workflows/build.yml

+4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ jobs:
3939
run: rustup target add i686-unknown-linux-gnu && sudo apt update && sudo apt install -y gcc-multilib
4040
- name: Test (32-bit all-features)
4141
run: cargo test --target i686-unknown-linux-gnu --all-features
42+
- name: Install thumbv6m-none-eabi
43+
run: rustup target add thumbv6m-none-eabi
44+
- name: Check (no atomic ptr)
45+
run: cargo check --target thumbv6m-none-eabi --no-default-features --features derive,serde,arrayvec
4246
- name: Setup Miri
4347
run: cargo miri setup
4448
- name: Test (miri all-features)

src/derive/impls.rs

+1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ macro_rules! impl_smart_ptr {
109109
}
110110
impl_smart_ptr!(::alloc::boxed::Box);
111111
impl_smart_ptr!(::alloc::rc::Rc);
112+
#[cfg(target_has_atomic = "ptr")]
112113
impl_smart_ptr!(::alloc::sync::Arc);
113114

114115
impl<T: Encode, const N: usize> Encode for [T; N] {

0 commit comments

Comments
 (0)