diff options
| author | bors <bors@rust-lang.org> | 2019-02-25 20:24:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-02-25 20:24:10 +0000 |
| commit | 00aae71f503b1ab592f48de47dd30912f3858748 (patch) | |
| tree | 6a467dcb6c86ff08496ce29b1da9eaabc92538ac /src/libstd | |
| parent | b57fe74a27590289fd657614b8ad1f3eac8a7ad2 (diff) | |
| parent | cf267540ebabdeac1f2045819cd6bac561017e29 (diff) | |
| download | rust-00aae71f503b1ab592f48de47dd30912f3858748.tar.gz rust-00aae71f503b1ab592f48de47dd30912f3858748.zip | |
Auto merge of #58302 - SimonSapin:tryfrom, r=alexcrichton
Stabilize TryFrom and TryInto with a convert::Infallible empty enum This is the plan proposed in https://github.com/rust-lang/rust/issues/33417#issuecomment-423073898
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/error.rs | 6 | ||||
| -rw-r--r-- | src/libstd/lib.rs | 1 | ||||
| -rw-r--r-- | src/libstd/path.rs | 3 |
3 files changed, 4 insertions, 6 deletions
diff --git a/src/libstd/error.rs b/src/libstd/error.rs index ef8c97bebdf..17e50a649fa 100644 --- a/src/libstd/error.rs +++ b/src/libstd/error.rs @@ -466,14 +466,14 @@ impl Error for num::ParseIntError { } } -#[unstable(feature = "try_from", issue = "33417")] +#[stable(feature = "try_from", since = "1.34.0")] impl Error for num::TryFromIntError { fn description(&self) -> &str { self.__description() } } -#[unstable(feature = "try_from", issue = "33417")] +#[stable(feature = "try_from", since = "1.34.0")] impl Error for array::TryFromSliceError { fn description(&self) -> &str { self.__description() @@ -548,7 +548,7 @@ impl Error for cell::BorrowMutError { } } -#[unstable(feature = "try_from", issue = "33417")] +#[stable(feature = "try_from", since = "1.34.0")] impl Error for char::CharTryFromError { fn description(&self) -> &str { "converted integer out of range for `char`" diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 6dd3a6cc0fd..7af569ab350 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -296,7 +296,6 @@ #![feature(str_internals)] #![feature(thread_local)] #![feature(toowned_clone_into)] -#![feature(try_from)] #![feature(try_reserve)] #![feature(unboxed_closures)] #![feature(untagged_unions)] diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 240b92a17db..9f91a9f89eb 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -78,7 +78,6 @@ use iter::{self, FusedIterator}; use ops::{self, Deref}; use rc::Rc; use str::FromStr; -use string::ParseError; use sync::Arc; use ffi::{OsStr, OsString}; @@ -1533,7 +1532,7 @@ impl From<String> for PathBuf { #[stable(feature = "path_from_str", since = "1.32.0")] impl FromStr for PathBuf { - type Err = ParseError; + type Err = core::convert::Infallible; fn from_str(s: &str) -> Result<Self, Self::Err> { Ok(PathBuf::from(s)) |
