Skip to content

Commit

Permalink
Run cargo build against wasm32-unknown-unknown target to catch MIR …
Browse files Browse the repository at this point in the history
  • Loading branch information
mkeeter authored Apr 15, 2024
1 parent 058a3cb commit a53276d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/check-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ jobs:
- name: Install wasm target
run: rustup target add ${{ matrix.target }}
- name: Check
run: cargo check --target=${{ matrix.target }} -pfidget --no-default-features --features="rhai,render,mesh"
# cargo check doesn't find MIR diagnostics, so we use cargo build instead
# (https://github.com/rust-lang/rust/issues/49292)
run: cargo build --target=${{ matrix.target }} -pfidget --no-default-features --features="rhai,render,mesh"
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions fidget/src/mesh/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ impl From<Cell> for CellData {
Cell::Empty => 1,
Cell::Full => 2,
Cell::Branch { index, thread } => {
#[cfg(not(target_arch = "wasm32"))]
debug_assert!(index < (1 << 54));
0b10 << 62 | ((thread as u64) << 54) | index as u64
}
Cell::Leaf(Leaf { mask, index }) => {
#[cfg(not(target_arch = "wasm32"))]
debug_assert!(index < (1 << 54));
(0b11 << 62) | ((mask as u64) << 54) | index as u64
}
Expand Down

0 comments on commit a53276d

Please sign in to comment.