about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-03-31 08:03:15 +0200
committerGitHub <noreply@github.com>2023-03-31 08:03:15 +0200
commitec276c7e672c6deae091f05b4ba29f7bbe44f4cd (patch)
tree20684d4fe87dba194c330fd8d280d54b4d1962dc
parent0708fbf5cb6ace691559dcb08423099829519772 (diff)
parentbdb0c7f427c2be88e77b28cf21452cefc847b009 (diff)
downloadrust-ec276c7e672c6deae091f05b4ba29f7bbe44f4cd.tar.gz
rust-ec276c7e672c6deae091f05b4ba29f7bbe44f4cd.zip
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.
-rw-r--r--library/core/src/str/mod.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs
index 2b23f64732b..04169429949 100644
--- a/library/core/src/str/mod.rs
+++ b/library/core/src/str/mod.rs
@@ -2655,5 +2655,6 @@ impl_fn_for_zst! {
     };
 }
 
+// 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 {}