From 6ec570aca510597ca940e9ffbd60370bfcbc4562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Curley?= Date: Fri, 25 Aug 2023 13:00:54 +0100 Subject: [PATCH] Make `rustc_on_unimplemented` std-agnostic for `alloc::rc` --- library/core/src/marker.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index aec287226a055..ec1810234eb09 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -77,6 +77,7 @@ macro marker_impls { #[cfg_attr(not(test), rustc_diagnostic_item = "Send")] #[rustc_on_unimplemented( on(_Self = "std::rc::Rc", note = "use `std::sync::Arc` instead of `std::rc::Rc`"), + on(_Self = "alloc::rc::Rc", note = "use `alloc::sync::Arc` instead of `alloc::rc::Rc`"), message = "`{Self}` cannot be sent between threads safely", label = "`{Self}` cannot be sent between threads safely", note = "consider using `std::sync::Arc<{Self}>`; for more information visit \ @@ -632,6 +633,7 @@ impl Copy for &T {} note = "if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead", ), on(_Self = "std::rc::Rc", note = "use `std::sync::Arc` instead of `std::rc::Rc`"), + on(_Self = "alloc::rc::Rc", note = "use `alloc::sync::Arc` instead of `alloc::rc::Rc`"), message = "`{Self}` cannot be shared between threads safely", label = "`{Self}` cannot be shared between threads safely", note = "consider using `std::sync::Arc<{Self}>`; for more information visit \