about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-08-26 13:08:34 +0200
committerGitHub <noreply@github.com>2023-08-26 13:08:34 +0200
commitc3668d3d7c02fff8d7fbe594d4d5538c73f77f68 (patch)
treeb7dc9318179c831ce06b8fc3333db4f64f901e08
parent8e35b2082c774c66c17a839d6e1bb1c44cbe8a53 (diff)
parent6ec570aca510597ca940e9ffbd60370bfcbc4562 (diff)
downloadrust-c3668d3d7c02fff8d7fbe594d4d5538c73f77f68.tar.gz
rust-c3668d3d7c02fff8d7fbe594d4d5538c73f77f68.zip
Rollup merge of #115210 - DogPawHat:std-agnostic-rustc_on_unimplemented-for-alloc-rc, r=WaffleLapkin
Make `rustc_on_unimplemented` std-agnostic for `alloc::rc`

See https://github.com/rust-lang/rust/issues/112923

Just a few lines related to `alloc:rc` for `Send` and `Sync`.

That seems to be all of the `... = "std::..."` issues found, but there a few notes with `std::` inside them still.

r? `@WaffleLapkin`
-rw-r--r--library/core/src/marker.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs
index aec287226a0..ec1810234eb 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<T, A>", note = "use `std::sync::Arc` instead of `std::rc::Rc`"),
+    on(_Self = "alloc::rc::Rc<T, A>", 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<T: ?Sized> 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<T, A>", note = "use `std::sync::Arc` instead of `std::rc::Rc`"),
+    on(_Self = "alloc::rc::Rc<T, A>", 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 \