From fb6390f9d35e715f274d986d3be971b8d2749b00 Mon Sep 17 00:00:00 2001 From: Patrick Chieppe Date: Tue, 13 Jul 2021 23:18:57 +1000 Subject: [PATCH] Fix build on non-32/64-bit architectures (#1144) * Impl WideningMultiply for 16-bit pointers * Add AVR CI test job --- .github/workflows/test.yml | 14 ++++++++++++++ src/distributions/utils.rs | 2 ++ 2 files changed, 16 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8355d6b7c23..6c48d1e731e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -174,6 +174,20 @@ jobs: - name: Build top-level only run: cargo build --target=thumbv6m-none-eabi --no-default-features + test-avr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly-2021-01-07 # Pinned compiler version due to https://github.com/rust-lang/compiler-builtins/issues/400 + components: rust-src + override: true + - name: Build top-level only + run: cargo build -Z build-std=core --target=avr-unknown-gnu-atmega328 --no-default-features + test-ios: runs-on: macos-latest steps: diff --git a/src/distributions/utils.rs b/src/distributions/utils.rs index b11f602004e..0d50c91fa1f 100644 --- a/src/distributions/utils.rs +++ b/src/distributions/utils.rs @@ -138,6 +138,8 @@ macro_rules! wmul_impl_usize { } }; } +#[cfg(target_pointer_width = "16")] +wmul_impl_usize! { u16 } #[cfg(target_pointer_width = "32")] wmul_impl_usize! { u32 } #[cfg(target_pointer_width = "64")]