about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-06-01 00:57:37 +0000
committerbors <bors@rust-lang.org>2019-06-01 00:57:37 +0000
commit84f729d0d4dade321210b78f56bedd88025eeff6 (patch)
treedeff171b0bc9505fde5f9c29debd548643c8e28d /src/libstd
parent041bec87c022128556640b7091f479f3040c3c37 (diff)
parente32386d70ed2e5ba103b490c2aac56385bc88405 (diff)
downloadrust-84f729d0d4dade321210b78f56bedd88025eeff6.tar.gz
rust-84f729d0d4dade321210b78f56bedd88025eeff6.zip
Auto merge of #61394 - pietroalbini:rollup-lzugnb4, r=pietroalbini
Rollup of 11 pull requests

Successful merges:

 - #60897 (error: remove StringError from Debug output)
 - #61304 (Speed up Azure CI installing Windows dependencies)
 - #61319 (Swap order of `unsafe async fn` to `async unsafe fn`)
 - #61342 (Set ellipsis_inclusive_range_patterns lint to warn)
 - #61344 (Add regression test for const generics ICE)
 - #61359 (Fix links in Deref documentation)
 - #61363 (Stabilize iter_nth_back feature)
 - #61369 (Fixed lifetime misspelling)
 - #61372 (Migrate some books to mdbook version 0.2)
 - #61374 (Explicitly suggest 'type_ascription' feature)
 - #61382 (Fixed a typo in core::convert::AsMut)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/error.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libstd/error.rs b/src/libstd/error.rs
index c8978a94fcd..5cc7dcdae1f 100644
--- a/src/libstd/error.rs
+++ b/src/libstd/error.rs
@@ -314,7 +314,6 @@ impl From<String> for Box<dyn Error + Send + Sync> {
     ///     mem::size_of::<Box<dyn Error + Send + Sync>>() == mem::size_of_val(&a_boxed_error))
     /// ```
     fn from(err: String) -> Box<dyn Error + Send + Sync> {
-        #[derive(Debug)]
         struct StringError(String);
 
         impl Error for StringError {
@@ -327,6 +326,13 @@ impl From<String> for Box<dyn Error + Send + Sync> {
             }
         }
 
+        // Purposefully skip printing "StringError(..)"
+        impl Debug for StringError {
+            fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+                Debug::fmt(&self.0, f)
+            }
+        }
+
         Box::new(StringError(err))
     }
 }