From c7904edabb7a4fb7fcb4c959646e369c080e37c5 Mon Sep 17 00:00:00 2001 From: Patrick Chieppe Date: Tue, 13 Jul 2021 11:12:34 +1000 Subject: [PATCH 1/6] Impl WideningMultiply for smaller pointer sizes --- src/distributions/utils.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/distributions/utils.rs b/src/distributions/utils.rs index b11f602004e..67421130ad3 100644 --- a/src/distributions/utils.rs +++ b/src/distributions/utils.rs @@ -138,6 +138,10 @@ macro_rules! wmul_impl_usize { } }; } +#[cfg(target_pointer_width = "8")] +wmul_impl_usize! { u8 } +#[cfg(target_pointer_width = "16")] +wmul_impl_usize! { u16 } #[cfg(target_pointer_width = "32")] wmul_impl_usize! { u32 } #[cfg(target_pointer_width = "64")] From 12251da7103d1d9b4e5bd040fb34ec1ca5daaf08 Mon Sep 17 00:00:00 2001 From: Patrick Chieppe Date: Tue, 13 Jul 2021 15:05:42 +1000 Subject: [PATCH 2/6] Remove WideningMultiply impl for 8-bit pointers --- src/distributions/utils.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/distributions/utils.rs b/src/distributions/utils.rs index 67421130ad3..0d50c91fa1f 100644 --- a/src/distributions/utils.rs +++ b/src/distributions/utils.rs @@ -138,8 +138,6 @@ macro_rules! wmul_impl_usize { } }; } -#[cfg(target_pointer_width = "8")] -wmul_impl_usize! { u8 } #[cfg(target_pointer_width = "16")] wmul_impl_usize! { u16 } #[cfg(target_pointer_width = "32")] From 9e0d02bc2c07909a3ecd2cd0cbd604fe53bf34ff Mon Sep 17 00:00:00 2001 From: Patrick Chieppe Date: Tue, 13 Jul 2021 15:08:53 +1000 Subject: [PATCH 3/6] Add avr CI test job --- .github/workflows/test.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8355d6b7c23..e1d7cdf3ff9 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 + target: avr-unknown-gnu-atmega328 + override: true + - name: Build top-level only + run: cargo build --target=avr-unknown-gnu-atmega328 --no-default-features + test-ios: runs-on: macos-latest steps: From c28b4ddf8d349ee028efb20593f2565dfd3561fa Mon Sep 17 00:00:00 2001 From: Patrick Chieppe Date: Tue, 13 Jul 2021 15:12:07 +1000 Subject: [PATCH 4/6] Add build-std=core flag to CI --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e1d7cdf3ff9..28127719df5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -186,7 +186,7 @@ jobs: target: avr-unknown-gnu-atmega328 override: true - name: Build top-level only - run: cargo build --target=avr-unknown-gnu-atmega328 --no-default-features + run: cargo build -Z build-std=core --target=avr-unknown-gnu-atmega328 --no-default-features test-ios: runs-on: macos-latest From 6a68d4e8df67a624e13b2cda5372425e1a5ba007 Mon Sep 17 00:00:00 2001 From: Patrick Chieppe Date: Tue, 13 Jul 2021 16:03:47 +1000 Subject: [PATCH 5/6] Specify only rust-src as component in CI toolchain install --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 28127719df5..a849d9e6807 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -184,6 +184,7 @@ jobs: profile: minimal toolchain: nightly-2021-01-07 # Pinned compiler version due to https://github.com/rust-lang/compiler-builtins/issues/400 target: avr-unknown-gnu-atmega328 + 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 From 7632203e6247e3e408ae683d59300bd9b31ba47a Mon Sep 17 00:00:00 2001 From: Patrick Chieppe Date: Tue, 13 Jul 2021 17:04:58 +1000 Subject: [PATCH 6/6] Do not add target for AVR --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a849d9e6807..6c48d1e731e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -183,7 +183,6 @@ jobs: with: profile: minimal toolchain: nightly-2021-01-07 # Pinned compiler version due to https://github.com/rust-lang/compiler-builtins/issues/400 - target: avr-unknown-gnu-atmega328 components: rust-src override: true - name: Build top-level only