1
Fork 0

use the correct attributes and add helper function

This commit is contained in:
Roxane 2021-05-09 10:06:24 -04:00
parent acfc708b7c
commit 564b4de626
2 changed files with 84 additions and 102 deletions

View file

@ -132,7 +132,7 @@ pub fn panic_any<M: 'static + Any + Send>(msg: M) -> ! {
/// [`AssertUnwindSafe`] wrapper struct can be used to force this trait to be
/// implemented for any closed over variables passed to `catch_unwind`.
#[stable(feature = "catch_unwind", since = "1.9.0")]
#[cfg_attr(not(bootstrap), lang = "unwind_safe")]
#[cfg_attr(all(not(bootstrap), not(test)), lang = "unwind_safe")]
#[rustc_on_unimplemented(
message = "the type `{Self}` may not be safely transferred across an unwind boundary",
label = "`{Self}` may not be safely transferred across an unwind boundary"
@ -148,7 +148,7 @@ pub auto trait UnwindSafe {}
/// This is a "helper marker trait" used to provide impl blocks for the
/// [`UnwindSafe`] trait, for more information see that documentation.
#[stable(feature = "catch_unwind", since = "1.9.0")]
#[cfg_attr(not(bootstrap), lang = "ref_unwind_safe")]
#[cfg_attr(all(not(bootstrap), not(test)), lang = "ref_unwind_safe")]
#[rustc_on_unimplemented(
message = "the type `{Self}` may contain interior mutability and a reference may not be safely \
transferrable across a catch_unwind boundary",