From 97b775488eccd75e041266bafdfbe65965259f05 Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Wed, 14 Mar 2018 23:25:43 -0700 Subject: [PATCH] Replace new-in-1.26 ParsePathError with ! This has never been stable, so we can just get rid of the nominal type. --- src/libstd/path.rs | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/libstd/path.rs b/src/libstd/path.rs index ec96157547383..1a59fc93c3ff4 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -1442,26 +1442,10 @@ impl From for PathBuf { } } -/// Error returned from [`PathBuf::from_str`][`from_str`]. -/// -/// Note that parsing a path will never fail. This error is just a placeholder -/// for implementing `FromStr` for `PathBuf`. -/// -/// [`from_str`]: struct.PathBuf.html#method.from_str -#[derive(Debug, Clone, PartialEq, Eq)] -#[stable(feature = "path_from_str", since = "1.26.0")] -pub enum ParsePathError {} - -#[stable(feature = "path_from_str", since = "1.26.0")] -impl fmt::Display for ParsePathError { - fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result { - match *self {} - } -} - +/// Note that parsing a path will never fail. #[stable(feature = "path_from_str", since = "1.26.0")] impl FromStr for PathBuf { - type Err = ParsePathError; + type Err = !; fn from_str(s: &str) -> Result { Ok(PathBuf::from(s))