Skip to content
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

send error #1 #1

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

send error #1 #1

wants to merge 1 commit into from

Conversation

LucioFranco
Copy link
Owner

No description provided.

@@ -1,6 +1,6 @@
use crate::Service;

type BoxFuture<'a, T> = std::pin::Pin<Box<dyn 'a + std::future::Future<Output = T>>>;
type BoxFuture<'a, T> = std::pin::Pin<Box<dyn 'a + std::future::Future<Output = T> + Send>>;
Copy link
Owner Author

@LucioFranco LucioFranco Mar 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change causes line 53 to error with:

tower-playground on  lucio/send-error-1 [$?] is 📦 v0.1.0 via 🦀 v1.70.0-nightly
❯ cargo test
   Compiling tower v0.1.0 (/Users/luciofra/code/tower-playground)
error[E0277]: `impl Future<Output = Result<<T as Service<Req>>::Res, <T as Service<Req>>::Error>>` cannot be sent between threads safely
  --> src/box_service.rs:53:9
   |
53 |         Box::pin(self.call(req))
   |         ^^^^^^^^^^^^^^^^^^^^^^^^ `impl Future<Output = Result<<T as Service<Req>>::Res, <T as Service<Req>>::Error>>` cannot be sent between threads safely
   |
   = help: the trait `Send` is not implemented for `impl Future<Output = Result<<T as Service<Req>>::Res, <T as Service<Req>>::Error>>`
   = note: required for the cast from `impl Future<Output = Result<<T as Service<Req>>::Res, <T as Service<Req>>::Error>>` to the object type `dyn Future<Output = Result<<T as Service<Req>>::Res, <T as Service<Req>>::Error>> + Send`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `tower` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `tower` (lib test) due to previous error

Related rust-lang/rust#103854

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant