Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/frol/rust-futures03-wrapper-test
- Owner: frol
- Created: 2019-05-27T17:15:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-05-27T20:23:08.000Z (over 5 years ago)
- Last Synced: 2024-11-01T01:42:06.102Z (3 months ago)
- Language: Rust
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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>
```