Skip to content

Commit

Permalink
Rollup merge of #115210 - DogPawHat:std-agnostic-rustc_on_unimplement…
Browse files Browse the repository at this point in the history
…ed-for-alloc-rc, r=WaffleLapkin

Make `rustc_on_unimplemented` std-agnostic for `alloc::rc`

See #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`
  • Loading branch information
matthiaskrgr authored Aug 26, 2023
2 parents 8e35b20 + 6ec570a commit c3668d3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/core/src/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down

0 comments on commit c3668d3

Please sign in to comment.