Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upReceiver::Error should be something like Never or Nothing #476
Comments
alexcrichton
added
the
0.2-cleanup
label
May 15, 2017
This comment has been minimized.
This comment has been minimized.
|
BTW, |
This comment has been minimized.
This comment has been minimized.
|
... and Currently it has signature
Which gives user false sense that it is OK to return error. While it is not, error must be handled inside the future. |
srijs
referenced this issue
Jul 9, 2017
Closed
mpsc::Receiver's Error type should be uninhabited, not () #521
This comment has been minimized.
This comment has been minimized.
|
FWIW Elm uses |
This comment has been minimized.
This comment has been minimized.
|
When it's eventually stable, the never type ( |
This comment has been minimized.
This comment has been minimized.
|
I wrote in #554: Right now there's a number of locations in this library where
I've also heard of this being common enough throughout the ecosystem that I think we should provide a solution to this! I think we'll want to not "just add a enum Void {}
Void::into(self) -> T
Future<Item=T, Error=Void>::poll_ok(&mut self) -> Async<T>
Future<Item=T, Error=Void>::wait_ok(self) -> TAnd maybe more! I'm curious to hear what others think about adding such APIs. |
This comment has been minimized.
This comment has been minimized.
|
I wouldn't mind trying to game this out before an 0.2 release. We can't change existing types but we could add the type for external libraries to use, as well as the extra goodies on the |
This comment has been minimized.
This comment has been minimized.
|
Is there no hope of the never type being stabilized in a time frame that would make it reasonable to just wait on this issue rather than introduce a futures-specific void type? |
This comment has been minimized.
This comment has been minimized.
|
AFAIK yeah, the stabilization story for |
srijs
referenced this issue
Aug 28, 2017
Open
Core::spawn should expect Error=Void not Error=() #197
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton Are you saying you would consider a PR adding |
This comment has been minimized.
This comment has been minimized.
|
Certainly! Unfortunately we can't land a breaking change right now so we can't change the |
alexcrichton
added
C-feature-request
0.1-incompatible
labels
Jan 25, 2018
This comment has been minimized.
This comment has been minimized.
|
@jimmycuadra I havent looked to deep into
I was looking at a not up-to-date version of v0.2, the changes are there by now. |
This comment has been minimized.
This comment has been minimized.
|
This has been done for 0.2. |
stepancheg commentedMay 15, 2017
To clearly state that poll never fails.