-
Notifications
You must be signed in to change notification settings - Fork 55
Handling traits that return non-stable Futures #71
Comments
Interesting. I think there's a bound in Right now there's this impl impl<F: Future + Unpin> StableFuture for F I think that doesn't need to have the |
Yea, since its safe to call poll with &mut (or your impl is incorrect), I'd merge a PR to remove |
Yeah, it seems to me that that bound is backwards, it's always safe to call a impl<F: StableFuture + Unpin> Future for F Which matches up with the existing impl<T: Unpin> PinMut<T> { fn new(&mut T) -> PinMut<T>; }
impl<T: Unpin> DerefMut for PinMut<T> I'll open a PR to |
The impl has been changed to the futures-stable that is now merged into the rust-lang-nursery/futures-rs repository. futures-await needs to be changed to build off of that version of futures-rs, but once it is this will be fixed, so I'm closing this issue. :) |
Hey, any updates on this issue? I still get this error. |
@manuels this should be working with the latest master, you may need to In the mean time this repository has been merged into the |
Thanks for your answer, @Nemo157!
|
Ohhh, is that maybe because EDIT: |
Oh, that's why. Bummer, the futures-await brach |
You may be able to use the fork linked from #79 (comment), I'm not sure if there'll ever be a |
Great hint, thanks, @Nemo157! |
Unfortunately there's a lot of extraneous code here, but if you save the following as
examples/foo.rs
and runcargo build --examples
you get the below error message.The key part is declaring a trait with a
Future
as associated type, then passing an instance of that trait into a function defined via#[async_move]
and attempting toawait
the returnedFuture
.There's a straightforward fix:
but I'm wondering if there's a nicer way to do this that could be documented somewhere?
The text was updated successfully, but these errors were encountered: