dtolnay / async-trait

Type erasure for async trait methods
Apache License 2.0
1.81k stars 84 forks source link

Arc<Self> can lead to unknown lifetimes on default methods #117

Closed Denommus closed 4 years ago

Denommus commented 4 years ago

Seems related to #11

error[E0310]: the parameter type `AsyncTrait` may not live long enough
  --> jcpc/src/interface.rs:82:13
   |
15 | / #[async_trait]
16 | | pub trait JoyCon: Sync + Send {
   | |_ help: consider adding an explicit lifetime bound...: `AsyncTrait: 'static +`
...
82 |               tokio::spawn(async move {
   |               ^^^^^^^^^^^^ ...so that the type `impl std::future::Future` will meet its required lifetime bounds

error: aborting due to previous error

For more information about this error, try `rustc --explain E0310`.
error: could not compile `jcpc`.

To learn more, run the command again with --verbose.
Denommus commented 4 years ago

Sorry, this seems a duplicate of #108