Skip to content

Commit ec276c7

Browse files
authored
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.
2 parents 0708fbf + bdb0c7f commit ec276c7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/core/src/str/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2655,5 +2655,6 @@ impl_fn_for_zst! {
26552655
};
26562656
}
26572657

2658+
// This is required to make `impl From<&str> for Box<dyn Error>` and `impl<E> From<E> for Box<dyn Error>` not overlap.
26582659
#[stable(feature = "rust1", since = "1.0.0")]
26592660
impl !crate::error::Error for &str {}

0 commit comments

Comments
 (0)