Minimal Futures examples demonstrating confusing compiler errors

Could someone help me understand why the error is:

   = note: expected type `futures::FutureResult<{integer}, _>`
              found type `i32`

Rather than the reverse?

   = note: expected type `i32`
              found type `futures::FutureResult<{integer}, _>`

I thought the function signature is:

fn future_sign(v: i32) -> Box<Future<Item=i32, Error=i32> >

So it should be expecting i32 instead of futures::FutureResult<{integer}, _>?

1 Like