Uh oh!
There was an error while loading. Please reload this page.
replace convert::Infallible with ! - #49038
Conversation
rust-highfive
commented
Mar 15, 2018
r? @sfackler (rust_highfive has picked a reviewer for you, use r? to override) |
scottmcm
left a comment
There was a problem hiding this comment.
Horray! One step closer to stable TryFrom...
| } | ||
| #[unstable(feature = "try_from", issue = "33417")] | ||
| impl From<Infallible> for TryFromIntError { |
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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)] | ||
| pubenumInfallible{} |
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
They're implemented. No idea why they're not showing up in rustdoc.
There was a problem hiding this comment.
Ah, looks like this is a nearing-three-year-old bug with primitives: #25893
canndrew
commented
Mar 15, 2018
It looks like the travis failure here had nothing to do with this PR. |
Replace uninhabited error enums in std with never Luckily I only found two, and one of them isn't in beta yet, so can disappear completely 😎 Are there any others I forgot? (There are lots in things like liblibc and libstd/sys, but AFAIK those don't matter, nor do things like `btree::node::LeafOrInternal` or `str::pattern::RejectAndMatch`.) The unstable `convert::Infallible` is being handled by #49038⚠️ This change may be a 1.26-or-never one. cc #48950 (comment) r? @alexcrichton
SimonSapin
commented
Mar 16, 2018
|
edb2fdb to
15bab45Comparecanndrew
commented
Mar 16, 2018
Oops, thanks for pointing that out. |
SimonSapin
commented
Mar 17, 2018
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 |
SimonSapin
commented
Mar 17, 2018
I’ve filed #49123 for that rustdoc test failure. |
SimonSapin
commented
Mar 21, 2018
bors
commented
Mar 21, 2018
📌 Commit 15bab45 has been approved by |
…ver, r=SimonSapin replace `convert::Infallible` with `!`
There are several empty enum types in std. For example: implFromStrforString{typeErr = ParseError;}My question is, are they going to be replaced by |
SimonSapin
commented
Mar 29, 2018
This is being discussed at #49039 |
No description provided.