about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2022-04-26 13:22:27 +0200
committerGitHub <noreply@github.com>2022-04-26 13:22:27 +0200
commit2b8bf0d530f8be971264b2430f40217433568968 (patch)
tree7146a9c670ffe9923e43d8684fcaad207d95dd7f
parentfe49981ea0069f6b89e4511d5de92b7027d9b688 (diff)
parent8d5a4963df609e27d8daff49cee792f200e03408 (diff)
downloadrust-2b8bf0d530f8be971264b2430f40217433568968.tar.gz
rust-2b8bf0d530f8be971264b2430f40217433568968.zip
Rollup merge of #95949 - SoniEx2:patch-5, r=m-ou-se
Implement Default for AssertUnwindSafe

Trait impls are still insta-stable yeah...?
-rw-r--r--library/core/src/panic/unwind_safe.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/library/core/src/panic/unwind_safe.rs b/library/core/src/panic/unwind_safe.rs
index 95be879e319..f2948aac3c2 100644
--- a/library/core/src/panic/unwind_safe.rs
+++ b/library/core/src/panic/unwind_safe.rs
@@ -279,6 +279,13 @@ impl<T: fmt::Debug> fmt::Debug for AssertUnwindSafe<T> {
     }
 }
 
+#[stable(feature = "assertunwindsafe_default", since = "1.62.0")]
+impl<T: Default> Default for AssertUnwindSafe<T> {
+    fn default() -> Self {
+        Self(Default::default())
+    }
+}
+
 #[stable(feature = "futures_api", since = "1.36.0")]
 impl<F: Future> Future for AssertUnwindSafe<F> {
     type Output = F::Output;