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 upreplace `convert::Infallible` with `!` #49038
Conversation
rust-highfive
assigned
sfackler
Mar 15, 2018
This comment has been minimized.
This comment has been minimized.
|
r? @sfackler (rust_highfive has picked a reviewer for you, use r? to override) |
rust-highfive
added
the
S-waiting-on-review
label
Mar 15, 2018
This was referenced Mar 15, 2018
scottmcm
reviewed
Mar 15, 2018
|
Horray! One step closer to stable |
| @@ -3595,20 +3595,12 @@ impl fmt::Display for TryFromIntError { | |||
| } | |||
| } | |||
|
|
|||
| #[unstable(feature = "try_from", issue = "33417")] | |||
| impl From<Infallible> for TryFromIntError { | |||
This comment has been minimized.
This comment has been minimized.
scottmcm
Mar 15, 2018
•
Member
Maybe leave this as impl From<!> For TryFromIntError? This is here so that you can use u32: TryFrom<u16> in a method returning Result<_, TryFromIntError>, which I think is still wanted. (Not for those types literally, but for when they're c_whatever aliases.)
This comment has been minimized.
This comment has been minimized.
canndrew
Mar 15, 2018
•
Author
Contributor
I removed it thinking that we'd have impl<T> From<!> for T, but since we won't have that until we have specialization with intersection impls I guess I'd better add it back.
| /// signals to both the compiler and the user that the error case is impossible. | ||
| #[unstable(feature = "try_from", issue = "33417")] | ||
| #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] | ||
| pub enum Infallible {} |
This comment has been minimized.
This comment has been minimized.
scottmcm
Mar 15, 2018
Member
Looking through that list of derives, are we missing Copy and Clone for !? They're not in the rustdoc, at least: https://doc.rust-lang.org/nightly/std/primitive.never.html#implementations
(Not a blocker for this PR, of course.)
This comment has been minimized.
This comment has been minimized.
canndrew
Mar 15, 2018
Author
Contributor
They're implemented. No idea why they're not showing up in rustdoc.
This comment has been minimized.
This comment has been minimized.
scottmcm
Mar 15, 2018
Member
Ah, looks like this is a nearing-three-year-old bug with primitives: #25893
This comment has been minimized.
This comment has been minimized.
|
It looks like the travis failure here had nothing to do with this PR. |
scottmcm
referenced this pull request
Mar 15, 2018
Closed
Replace uninhabited error enums in std with never #49039
bors
added a commit
that referenced
this pull request
Mar 15, 2018
This comment has been minimized.
This comment has been minimized.
|
canndrew
force-pushed the
canndrew:replace-infallible-with-never
branch
from
edb2fdb
to
15bab45
Mar 16, 2018
This comment has been minimized.
This comment has been minimized.
|
Oops, thanks for pointing that out. |
This comment has been minimized.
This comment has been minimized.
This looks like the same as #48265 (comment), you may need to swap the order of bounds in the expected rustdoc output in the comment in Something like |
This comment has been minimized.
This comment has been minimized.
|
I’ve filed #49123 for that rustdoc test failure. |
SimonSapin
referenced this pull request
Mar 18, 2018
Closed
Rustdoc: where bounds order in synthetic impls is not deterministic #49123
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
bors
added
S-waiting-on-bors
and removed
S-waiting-on-review
labels
Mar 21, 2018
kennytm
added a commit
to kennytm/rust
that referenced
this pull request
Mar 22, 2018
bors
added a commit
that referenced
this pull request
Mar 22, 2018
alexcrichton
merged commit 15bab45
into
rust-lang:master
Mar 22, 2018
1 check failed
This comment has been minimized.
This comment has been minimized.
|
There are several empty enum types in std. For example: impl FromStr for String {
type Err = ParseError;
}My question is, are they going to be replaced by |
This comment has been minimized.
This comment has been minimized.
|
This is being discussed at #49039 |
canndrew commentedMar 15, 2018
No description provided.