Skip to content

Commit

Permalink
Fix compilation error on wasm (bevyengine#549)
Browse files Browse the repository at this point in the history
Fix compilation error on wasm
  • Loading branch information
Stjepan Glavina authored Sep 21, 2020
1 parent b5f3585 commit 74f881f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ jobs:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"

- name: Check wasm
uses: actions-rs/cargo@v1
with:
command: check
target: wasm32-unknown-unknown
override: true

clean:
runs-on: ubuntu-latest
steps:
Expand Down
7 changes: 4 additions & 3 deletions crates/bevy_tasks/src/single_threaded_task_pool.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::{
future::Future,
mem,
pin::Pin,
sync::{Arc, Mutex},
};

Expand Down Expand Up @@ -63,10 +62,12 @@ impl TaskPool {
F: FnOnce(&mut Scope<'scope, T>) + 'scope + Send,
T: Send + 'static,
{
let executor = async_executor::LocalExecutor::new();
let executor = &async_executor::LocalExecutor::new();
let executor: &'scope async_executor::LocalExecutor<'scope> =
unsafe { mem::transmute(executor) };

let mut scope = Scope {
executor: &executor,
executor,
results: Vec::new(),
};

Expand Down

0 comments on commit 74f881f

Please sign in to comment.