You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But when I run it with egui 0.22.0 (or with the current master) I get the following error:
error[E0277]: `(dyn for<'a> Fn(usize, &'a egui::Style) -> Option<Color32> + 'static)` cannot be shared between threads safely
--> src/main.rs:4:11
|
4 | foo::<egui::Ui>();
| ^^^^^^^^ `(dyn for<'a> Fn(usize, &'a egui::Style) -> Option<Color32> + 'static)` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `(dyn for<'a> Fn(usize, &'a egui::Style) -> Option<Color32> + 'static)`
= note: required for `Unique<(dyn for<'a> Fn(usize, &'a egui::Style) -> Option<Color32> + 'static)>` to implement `Sync`
= note: required because it appears within the type `Box<dyn Fn(usize, &Style) -> Option<Color32>>`
= note: required because it appears within the type `Option<Box<dyn Fn(usize, &Style) -> Option<Color32>>>`
= note: required because it appears within the type `GridLayout`
= note: required because it appears within the type `Option<GridLayout>`
= note: required because it appears within the type `Placer`
= note: required because it appears within the type `Ui`
note: required by a bound in `foo`
--> src/main.rs:1:11
|
1 | fn foo<T: Sync>() {}
| ^^^^ required by this bound in `foo`
Having a Send + Sync handle to the UI is useful for some workflow (or maybe just for my specific workflow...), and I think a function that picks a color shouldn't be the thing to break it.
I can make a PR to restrict that Fn to be Send + Sync.
The text was updated successfully, but these errors were encountered:
With egui 0.21 this code would build
But when I run it with egui 0.22.0 (or with the current master) I get the following error:
Having a
Send + Sync
handle to the UI is useful for some workflow (or maybe just for my specific workflow...), and I think a function that picks a color shouldn't be the thing to break it.I can make a PR to restrict that
Fn
to beSend + Sync
.The text was updated successfully, but these errors were encountered: