@@ -2031,19 +2031,23 @@ impl ops::DerefMut for String {
2031
2031
2032
2032
/// An error when parsing a `String`.
2033
2033
///
2034
+ /// As of Rust 1.26, this is a type alias for [`!`]. Code that doesn't need to
2035
+ /// support compilation with older compiler versions should just use that type
2036
+ /// directly; this alias will be deprecated in the future.
2037
+ ///
2034
2038
/// This `enum` is slightly awkward: it will never actually exist. This error is
2035
2039
/// part of the type signature of the implementation of [`FromStr`] on
2036
2040
/// [`String`]. The return type of [`from_str`], requires that an error be
2037
2041
/// defined, but, given that a [`String`] can always be made into a new
2038
2042
/// [`String`] without error, this type will never actually be returned. As
2039
2043
/// such, it is only here to satisfy said signature, and is useless otherwise.
2040
2044
///
2045
+ /// [`!`]: ../../std/primitive.never.html
2041
2046
/// [`FromStr`]: ../../std/str/trait.FromStr.html
2042
2047
/// [`String`]: struct.String.html
2043
2048
/// [`from_str`]: ../../std/str/trait.FromStr.html#tymethod.from_str
2044
2049
#[ stable( feature = "str_parse_error" , since = "1.5.0" ) ]
2045
- #[ derive( Copy ) ]
2046
- pub enum ParseError { }
2050
+ pub type ParseError = !;
2047
2051
2048
2052
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2049
2053
impl FromStr for String {
@@ -2054,37 +2058,6 @@ impl FromStr for String {
2054
2058
}
2055
2059
}
2056
2060
2057
- #[ stable( feature = "str_parse_error" , since = "1.5.0" ) ]
2058
- impl Clone for ParseError {
2059
- fn clone ( & self ) -> ParseError {
2060
- match * self { }
2061
- }
2062
- }
2063
-
2064
- #[ stable( feature = "str_parse_error" , since = "1.5.0" ) ]
2065
- impl fmt:: Debug for ParseError {
2066
- fn fmt ( & self , _: & mut fmt:: Formatter ) -> fmt:: Result {
2067
- match * self { }
2068
- }
2069
- }
2070
-
2071
- #[ stable( feature = "str_parse_error2" , since = "1.8.0" ) ]
2072
- impl fmt:: Display for ParseError {
2073
- fn fmt ( & self , _: & mut fmt:: Formatter ) -> fmt:: Result {
2074
- match * self { }
2075
- }
2076
- }
2077
-
2078
- #[ stable( feature = "str_parse_error" , since = "1.5.0" ) ]
2079
- impl PartialEq for ParseError {
2080
- fn eq ( & self , _: & ParseError ) -> bool {
2081
- match * self { }
2082
- }
2083
- }
2084
-
2085
- #[ stable( feature = "str_parse_error" , since = "1.5.0" ) ]
2086
- impl Eq for ParseError { }
2087
-
2088
2061
/// A trait for converting a value to a `String`.
2089
2062
///
2090
2063
/// This trait is automatically implemented for any type which implements the
0 commit comments