Skip to content

Commit 9fdf89f

Browse files
authored
Fix non-x86(_64) builds (#109)
1 parent ecf08dd commit 9fdf89f

2 files changed

Lines changed: 31 additions & 11 deletions

File tree

.github/workflows/rust.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,47 @@ env:
1212

1313
jobs:
1414
# Ensure the crate builds
15-
build:
16-
15+
build_x86_64:
1716
runs-on: ubuntu-latest
1817
strategy:
1918
matrix:
2019
rust: [1.56.0, stable, nightly]
21-
features: ["+avx2", "+sse2", "-avx2,-sse2"]
20+
features: ["+avx2", "+sse2"]
2221
env:
23-
RUSTCFLAGS: "-C target-features={{matrix.features}}"
22+
RUSTFLAGS: "-C target-feature=${{matrix.features}}"
2423
steps:
2524
- uses: actions/checkout@v4
2625
- uses: dtolnay/rust-toolchain@stable
2726
with:
27+
target: x86_64-unknown-linux-gnu
2828
profile: minimal
2929
toolchain: ${{ matrix.rust }}
3030
override: true
31-
- name: Tests
31+
- name: Tests (x86_64)
3232
run: |
3333
cargo test -v --no-default-features --tests --lib &&
3434
cargo build --verbose --features "$FEATURES" &&
3535
cargo test --verbose --features "$FEATURES" &&
3636
cargo test --verbose --release --features "$FEATURES"
3737
38+
build_aarch64:
39+
runs-on: ubuntu-latest
40+
strategy:
41+
matrix:
42+
rust: [1.56.0, stable, nightly]
43+
steps:
44+
- uses: actions/checkout@v4
45+
- uses: dtolnay/rust-toolchain@stable
46+
with:
47+
target: aarch64-unknown-linux-gnu
48+
profile: minimal
49+
toolchain: ${{ matrix.rust }}
50+
override: true
51+
- name: Tests (aarch64)
52+
run: cargo check --target aarch64-unknown-linux-gnu
53+
3854
# Use clippy to lint for code smells
3955
clippy:
40-
4156
runs-on: ubuntu-latest
4257
strategy:
4358
matrix:
@@ -58,13 +73,11 @@ jobs:
5873
5974
# Enforce rustfmt formatting
6075
formatting:
61-
6276
runs-on: ubuntu-latest
6377
strategy:
6478
matrix:
6579
# Run formatting checks only on stable
6680
rust: [stable]
67-
6881
steps:
6982
- uses: actions/checkout@v4
7083
- uses: dtolnay/rust-toolchain@stable
@@ -79,13 +92,11 @@ jobs:
7992
8093
# Ensure the benchmarks compile
8194
benchmark_compiles:
82-
8395
runs-on: ubuntu-latest
8496
strategy:
8597
matrix:
8698
# Check builds only on stable
8799
rust: [stable]
88-
89100
steps:
90101
- uses: actions/checkout@v4
91102
- uses: dtolnay/rust-toolchain@stable
@@ -102,7 +113,6 @@ jobs:
102113
build-wasm:
103114
runs-on: ubuntu-latest
104115
timeout-minutes: 30
105-
needs: build
106116
steps:
107117
- uses: actions/checkout@v4
108118
- uses: dtolnay/rust-toolchain@stable

src/block/default.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ impl Block {
1111
pub const ALL: Self = Block(!0);
1212
pub const BITS: usize = core::mem::size_of::<Self>() * 8;
1313

14+
#[inline]
15+
pub fn into_usize_array(self) -> [usize; Self::USIZE_COUNT] {
16+
[self.0]
17+
}
18+
19+
#[inline]
20+
pub const fn from_usize_array(array: [usize; Self::USIZE_COUNT]) -> Self {
21+
Self(array[0])
22+
}
23+
1424
#[inline]
1525
pub const fn is_empty(self) -> bool {
1626
self.0 == Self::NONE.0

0 commit comments

Comments
 (0)