Skip to content

Commit 43637bb

Browse files
committed
use the correct attributes and add helper function
1 parent f016155 commit 43637bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

std/src/panic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ pub fn panic_any<M: 'static + Any + Send>(msg: M) -> ! {
132132
/// [`AssertUnwindSafe`] wrapper struct can be used to force this trait to be
133133
/// implemented for any closed over variables passed to `catch_unwind`.
134134
#[stable(feature = "catch_unwind", since = "1.9.0")]
135-
#[cfg_attr(not(bootstrap), lang = "unwind_safe")]
135+
#[cfg_attr(all(not(bootstrap), not(test)), lang = "unwind_safe")]
136136
#[rustc_on_unimplemented(
137137
message = "the type `{Self}` may not be safely transferred across an unwind boundary",
138138
label = "`{Self}` may not be safely transferred across an unwind boundary"
@@ -148,7 +148,7 @@ pub auto trait UnwindSafe {}
148148
/// This is a "helper marker trait" used to provide impl blocks for the
149149
/// [`UnwindSafe`] trait, for more information see that documentation.
150150
#[stable(feature = "catch_unwind", since = "1.9.0")]
151-
#[cfg_attr(not(bootstrap), lang = "ref_unwind_safe")]
151+
#[cfg_attr(all(not(bootstrap), not(test)), lang = "ref_unwind_safe")]
152152
#[rustc_on_unimplemented(
153153
message = "the type `{Self}` may contain interior mutability and a reference may not be safely \
154154
transferrable across a catch_unwind boundary",

0 commit comments

Comments
 (0)