Skip to content

Instantly share code, notes, and snippets.

@aep
Created April 22, 2018 09:33
Show Gist options
  • Save aep/3d4ff4f0907a0a6b1d799f225fafe841 to your computer and use it in GitHub Desktop.
Save aep/3d4ff4f0907a0a6b1d799f225fafe841 to your computer and use it in GitHub Desktop.
struct DropDebug<F : futures::Future> (F);
impl<F : futures::Future> futures::Stream for DropDebug<F> {
type Item = F::Item;
type Error = F::Error;
fn poll(&mut self) -> futures::Poll<Self::Item, Self::Error> {
self.0.poll()
}
}
error[E0053]: method `poll` has an incompatible type for trait
--> src/server.rs:36:5
|
36 | fn poll(&mut self) -> futures::Poll<A, B> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `std::option::Option`, found type parameter
|
= note: expected type `fn(&mut DropDeadFuture<F>) -> std::result::Result<futures::Async<std::option::Option<_>>, _>`
found type `fn(&mut DropDeadFuture<F>) -> std::result::Result<futures::Async<A>, B>`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment