@@ -2106,26 +2106,19 @@ impl ops::DerefMut for String {
21062106 }
21072107}
21082108
2109- /// An error when parsing a `String` .
2109+ /// A type alias for [`Infallible`] .
21102110///
2111- /// This `enum` is slightly awkward: it will never actually exist. This error is
2112- /// part of the type signature of the implementation of [`FromStr`] on
2113- /// [`String`]. The return type of [`from_str`], requires that an error be
2114- /// defined, but, given that a [`String`] can always be made into a new
2115- /// [`String`] without error, this type will never actually be returned. As
2116- /// such, it is only here to satisfy said signature, and is useless otherwise.
2111+ /// This alias exists for backwards compatibility, and may be eventually deprecated.
21172112///
2118- /// [`FromStr`]: ../../std/str/trait.FromStr.html
2119- /// [`String`]: struct.String.html
2120- /// [`from_str`]: ../../std/str/trait.FromStr.html#tymethod.from_str
2113+ /// [`Infallible`]: ../../core/convert/enum.Infallible.html
21212114#[ stable( feature = "str_parse_error" , since = "1.5.0" ) ]
21222115pub type ParseError = core:: convert:: Infallible ;
21232116
21242117#[ stable( feature = "rust1" , since = "1.0.0" ) ]
21252118impl FromStr for String {
21262119 type Err = core:: convert:: Infallible ;
21272120 #[ inline]
2128- fn from_str ( s : & str ) -> Result < String , ParseError > {
2121+ fn from_str ( s : & str ) -> Result < String , Self :: Err > {
21292122 Ok ( String :: from ( s) )
21302123 }
21312124}
0 commit comments