From cf4bdd06db7faf7e8e7fb43c2d3e5f3a8bf608e5 Mon Sep 17 00:00:00 2001 From: Jack Wrenn Date: Thu, 21 Jul 2022 17:53:01 +0000 Subject: [PATCH] safe transmute: add `rustc_on_unimplemented` to `BikeshedIntrinsicFrom` ref: https://github.com/rust-lang/rust/pull/92268#discussion_r925266583 --- core/src/mem/transmutability.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/mem/transmutability.rs b/core/src/mem/transmutability.rs index 52342f8a0..820a7582b 100644 --- a/core/src/mem/transmutability.rs +++ b/core/src/mem/transmutability.rs @@ -5,6 +5,10 @@ /// notwithstanding whatever safety checks you have asked the compiler to [`Assume`] are satisfied. #[unstable(feature = "transmutability", issue = "none")] #[cfg_attr(not(bootstrap), lang = "transmute_trait")] +#[rustc_on_unimplemented( + message = "`{Src}` cannot be safely transmuted into `{Self}` in the defining scope of `{Context}`.", + label = "`{Src}` cannot be safely transmuted into `{Self}` in the defining scope of `{Context}`." +)] pub unsafe trait BikeshedIntrinsicFrom< Src, Context,