Rollup merge of #109793 - lukas-code:negative-impl-comment, r=scottmcm

add comment to `impl !Error for &str`

I saw this impl in the [standard library docs](https://doc.rust-lang.org/nightly/core/error/trait.Error.html#impl-Error-for-%26str) and wondered why it's needed. This commit adds a comment to explain its existence.
This commit is contained in:
Matthias Krüger 2023-03-31 08:03:15 +02:00 committed by GitHub
commit ec276c7e67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2655,5 +2655,6 @@ struct UnsafeBytesToStr impl<'a> Fn = |bytes: &'a [u8]| -> &'a str {
};
}
// This is required to make `impl From<&str> for Box<dyn Error>` and `impl<E> From<E> for Box<dyn Error>` not overlap.
#[stable(feature = "rust1", since = "1.0.0")]
impl !crate::error::Error for &str {}