-
Notifications
You must be signed in to change notification settings - Fork 633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove StreamObj and soft-deprecate FutureObj #1352
Comments
For comparison, here's a branch adding the aliases to |
it'd be nice if we could somehow default to |
Yeah, I did try out |
sounds like someone should write an RFC ;) |
I'm running into a minor problem with
I already have |
@ebkalderon is this code public somewhere, I can try and track down what's going wrong (my understanding is it should be calling |
@Nemo157 Unfortunately, no. But I have successfully reproduced the error in a minimal verifiable example and pushed it up to a new repository here, if you would like to take a look: ebkalderon/shared-box-future-example Edit: I have pushed a second commit showing the |
@ebkalderon thanks, that helped a lot. The issue is that The best fix for this would be to use I don't know if there's any way to improve the error message here, somehow tell Rust that the |
Relevant discussion on Runtime's use of |
For some prior context see #1348
Now that futures and streams are object safe there should be no reason to use
FutureObj
/StreamObj
directly. There are currently two reasons I know of to use these:Spawn::spawn_obj
. Rather than using this directly most users can useSpawnExt::spawn
instead to automatically convert the future into aFutureObj
(the only exception I know of isno_std
use).(am I missing any other use cases? I admit I've personally never used
FutureObj
)Proposed additions to
futures
:Using
SpawnExt::spawn
for aBoxFuture<'static, ()>
will cause a double indirection, this can be mitigated by either specialization (maybe, I don't know whether this is specializable) or an additionalSpawnExt::spawn_box
method that directly converts the boxed future into aFutureObj
.The text was updated successfully, but these errors were encountered: