Use diagnostic items to check for Send, UnwindSafe and RefUnwindSafe traits
This commit is contained in:
parent
3e569dd2df
commit
06afafd492
3 changed files with 9 additions and 7 deletions
|
@ -133,7 +133,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")]
|
||||
#[rustc_diagnostic_item = "unwind_safe_trait"]
|
||||
#[cfg_attr(not(test), rustc_diagnostic_item = "unwind_safe_trait")]
|
||||
#[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"
|
||||
|
@ -149,7 +149,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")]
|
||||
#[rustc_diagnostic_item = "ref_unwind_safe_trait"]
|
||||
#[cfg_attr(not(test), rustc_diagnostic_item = "ref_unwind_safe_trait")]
|
||||
#[rustc_on_unimplemented(
|
||||
message = "the type `{Self}` may contain interior mutability and a reference may not be safely \
|
||||
transferrable across a catch_unwind boundary",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue