-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing Sync
somewhere along the chain of Pool::get
#333
Comments
Could you provide a minimal reproduction example. |
Done #334 |
Actually I realized that I had something like this setup in Actix and the only difference between our types is this: - Pin<Box<dyn Future<Output = ()> + Send + Sync>>;
+ Pin<Box<dyn Future<Output = ()>>>; I guess |
The future returned by I do wonder why you need it to be After removing the - type ClosureFuture = Pin<Box<dyn std::future::Future<Output = ()> + Send + Sync>>;
- async fn test_closure<T: Fn(String) -> ClosureFuture + Send + Sync + 'static>(_: T) {
+ type ClosureFuture = Pin<Box<dyn std::future::Future<Output = ()> + Send>>;
+ async fn test_closure<T: Fn(String) -> ClosureFuture + Send + 'static>(_: T) { |
I'm not very good with async in Rust so I was just slapping |
Adding
Source: https://discord.com/channels/500028886025895936/500336333500448798/1252281055881334784 If you end up with some code that requires the future to be I'd be willing to change the deadpool crate so it returns Unless this becomes a major show stopper somewhere I won't be looking into that though. PRs welcome! |
Thanks for all the reference it's super helpful! This issue is caused by me, not another library requiring the trait, so I was able to just remove the Sync trait from that future. |
db.get().await;
causes problems with the future resulting in an error. I'm not sure exactly where the issue lies.The text was updated successfully, but these errors were encountered: