mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 04:33:37 +00:00
Fix wrong transmuted type in TaskPool::scope_with_executor_inner
(#11455)
# Objective
#8219 changed the target type of a `transmute` without changing the one
transmuting from ([see the relevant
diff](55e9ab7c92 (diff-11413fb2eeba97978379d325353d32aa76eefd0af0c8e9b50b7f394ddfda7a26R351-R355)
)),
making them incompatible. This PR fixes this by changing the initial
type to match the target one (modulo lifetimes).
## Solution
Change the type to be transmuted from to match the one transmuting into
(modulo lifetimes)
This commit is contained in:
parent
18833fa67c
commit
0fa14c86de
1 changed files with 2 additions and 1 deletions
|
@ -360,7 +360,8 @@ impl TaskPool {
|
|||
unsafe { mem::transmute(external_executor) };
|
||||
// SAFETY: As above, all futures must complete in this function so we can change the lifetime
|
||||
let scope_executor: &'env ThreadExecutor<'env> = unsafe { mem::transmute(scope_executor) };
|
||||
let spawned: ConcurrentQueue<FallibleTask<T>> = ConcurrentQueue::unbounded();
|
||||
let spawned: ConcurrentQueue<FallibleTask<Result<T, Box<(dyn std::any::Any + Send)>>>> =
|
||||
ConcurrentQueue::unbounded();
|
||||
// shadow the variable so that the owned value cannot be used for the rest of the function
|
||||
// SAFETY: As above, all futures must complete in this function so we can change the lifetime
|
||||
let spawned: &'env ConcurrentQueue<
|
||||
|
|
Loading…
Reference in a new issue