rollup merge of #24310: alexcrichton/stabilize-utf8-error

The meaning of each variant of this enum was somewhat ambiguous and it's uncler
that we wouldn't even want to add more enumeration values in the future. As a
result this error has been altered to instead become an opaque structure.
Learning about the "first invalid byte index" is still an unstable feature, but
the type itself is now stable.
This commit is contained in:
Alex Crichton
2015-04-14 10:55:41 -07:00
6 changed files with 26 additions and 38 deletions
+1 -4
View File
@@ -122,10 +122,7 @@ fn description(&self) -> &str { "failed to parse bool" }
#[stable(feature = "rust1", since = "1.0.0")]
impl Error for str::Utf8Error {
fn description(&self) -> &str {
match *self {
str::Utf8Error::TooShort => "invalid utf-8: not enough bytes",
str::Utf8Error::InvalidByte(..) => "invalid utf-8: corrupt contents",
}
"invalid utf-8: corrupt contents"
}
}