@@ -1958,19 +1958,23 @@ impl ops::DerefMut for String {
1958
1958
1959
1959
/// An error when parsing a `String`.
1960
1960
///
1961
+ /// As of Rust 1.26, this is a type alias for [`!`]. Code that doesn't need to
1962
+ /// support compilation with older compiler versions should just use that type
1963
+ /// directly; this alias will be deprecated in the future.
1964
+ ///
1961
1965
/// This `enum` is slightly awkward: it will never actually exist. This error is
1962
1966
/// part of the type signature of the implementation of [`FromStr`] on
1963
1967
/// [`String`]. The return type of [`from_str`], requires that an error be
1964
1968
/// defined, but, given that a [`String`] can always be made into a new
1965
1969
/// [`String`] without error, this type will never actually be returned. As
1966
1970
/// such, it is only here to satisfy said signature, and is useless otherwise.
1967
1971
///
1972
+ /// [`!`]: ../../std/primitive.never.html
1968
1973
/// [`FromStr`]: ../../std/str/trait.FromStr.html
1969
1974
/// [`String`]: struct.String.html
1970
1975
/// [`from_str`]: ../../std/str/trait.FromStr.html#tymethod.from_str
1971
1976
#[ stable( feature = "str_parse_error" , since = "1.5.0" ) ]
1972
- #[ derive( Copy ) ]
1973
- pub enum ParseError { }
1977
+ pub type ParseError = !;
1974
1978
1975
1979
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1976
1980
impl FromStr for String {
@@ -1981,37 +1985,6 @@ impl FromStr for String {
1981
1985
}
1982
1986
}
1983
1987
1984
- #[ stable( feature = "str_parse_error" , since = "1.5.0" ) ]
1985
- impl Clone for ParseError {
1986
- fn clone ( & self ) -> ParseError {
1987
- match * self { }
1988
- }
1989
- }
1990
-
1991
- #[ stable( feature = "str_parse_error" , since = "1.5.0" ) ]
1992
- impl fmt:: Debug for ParseError {
1993
- fn fmt ( & self , _: & mut fmt:: Formatter ) -> fmt:: Result {
1994
- match * self { }
1995
- }
1996
- }
1997
-
1998
- #[ stable( feature = "str_parse_error2" , since = "1.8.0" ) ]
1999
- impl fmt:: Display for ParseError {
2000
- fn fmt ( & self , _: & mut fmt:: Formatter ) -> fmt:: Result {
2001
- match * self { }
2002
- }
2003
- }
2004
-
2005
- #[ stable( feature = "str_parse_error" , since = "1.5.0" ) ]
2006
- impl PartialEq for ParseError {
2007
- fn eq ( & self , _: & ParseError ) -> bool {
2008
- match * self { }
2009
- }
2010
- }
2011
-
2012
- #[ stable( feature = "str_parse_error" , since = "1.5.0" ) ]
2013
- impl Eq for ParseError { }
2014
-
2015
1988
/// A trait for converting a value to a `String`.
2016
1989
///
2017
1990
/// This trait is automatically implemented for any type which implements the
0 commit comments