Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/frol/rust-futures03-wrapper-test

Broken Futures03 wrapper snippet
https://github.com/frol/rust-futures03-wrapper-test

Last synced: 30 days ago
JSON representation

Broken Futures03 wrapper snippet

Awesome Lists containing this project

README

        

NOTE: This is a snippet of Rust Futures 0.3 wrapper code that I cannot get working...

```
error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
--> src/main.rs:10:23
|
10 | Box::new(self.inner().boxed().compat())
| ^^^^^
|
note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 9:5...
--> src/main.rs:9:5
|
9 | / fn wrapper(&self) -> Box> {
10 | | Box::new(self.inner().boxed().compat())
11 | | }
| |_____^
note: ...so that reference does not outlive borrowed content
--> src/main.rs:10:18
|
10 | Box::new(self.inner().boxed().compat())
| ^^^^
= note: but, the lifetime must be valid for the static lifetime...
= note: ...so that the expression is assignable:
expected std::boxed::Box<(dyn futures::future::Future + 'static)>
found std::boxed::Box>
```