Rollup merge of #71633 - a1phyr:infallible_error, r=dtolnay

Impl Error for Infallible

This PR only changes the place where `impl Error for Infallible` is documented, as one could think that it is not the case when reading https://doc.rust-lang.org/nightly/std/convert/enum.Infallible.html.

Fixes #70842
This commit is contained in:
Yuki Okushi 2020-05-29 15:06:48 +09:00 committed by GitHub
commit a08a03ced7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,7 @@
// reconsider what crate these items belong in. // reconsider what crate these items belong in.
use core::array; use core::array;
use core::convert::Infallible;
use crate::alloc::{AllocErr, LayoutErr}; use crate::alloc::{AllocErr, LayoutErr};
use crate::any::TypeId; use crate::any::TypeId;
@ -474,7 +475,7 @@ impl Error for string::FromUtf16Error {
} }
#[stable(feature = "str_parse_error2", since = "1.8.0")] #[stable(feature = "str_parse_error2", since = "1.8.0")]
impl Error for string::ParseError { impl Error for Infallible {
fn description(&self) -> &str { fn description(&self) -> &str {
match *self {} match *self {}
} }