-
Notifications
You must be signed in to change notification settings - Fork 132
Open
Description
Worley noise (and some other functions) contain custom Rc<Fn> distance functions.
Usage of Rc makes these types non-Send, which makes it difficult to use in many ECS implementations
Would it be possible to change the type to Arc or possibly introduce a generic with a default value to get around these limitations?
error[E0277]: `Rc<(dyn for<'a, 'b> std::ops::Fn(&'a [f64], &'b [f64]) -> f64 + 'static)>` cannot be shared between threads safely
--> shared/src/entities/enemy_controller.rs:150:17
|
150 | idle_state: IdleState,
| ^^^^^^^^^ `Rc<(dyn for<'a, 'b> std::ops::Fn(&'a [f64], &'b [f64]) -> f64 + 'static)>` cannot be shared between threads safely
|
= help: within `IdleState`, the trait `Sync` is not implemented for `Rc<(dyn for<'a, 'b> std::ops::Fn(&'a [f64], &'b [f64]) -> f64 + 'static)>`, which is required by `IdleState: ComponentValue`
note: required because it appears within the type `Worley`
--> /home/freja/.cargo/registry/src/index.crates.io-6f17d22bba15001f/noise-0.9.0/src/noise_fns/generators/worley.rs:11:12
|
11 | pub struct Worley {
From looking at the code, a non-Send distance function is not required, as the provided distance functions are purely "math" and thus could be send.
Thanks
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels