@@ -76,8 +76,11 @@ macro marker_impls {
76
76
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
77
77
#[ cfg_attr( not( test) , rustc_diagnostic_item = "Send" ) ]
78
78
#[ rustc_on_unimplemented(
79
+ on( _Self = "std::rc::Rc<T, A>" , note = "use `std::sync::Arc` instead of `std::rc::Rc`" ) ,
79
80
message = "`{Self}` cannot be sent between threads safely" ,
80
- label = "`{Self}` cannot be sent between threads safely"
81
+ label = "`{Self}` cannot be sent between threads safely" ,
82
+ note = "consider using `std::sync::Arc<{Self}>`; for more information visit \
83
+ <https://doc.rust-lang.org/book/ch16-03-shared-state.html>"
81
84
) ]
82
85
pub unsafe auto trait Send {
83
86
// empty.
@@ -628,8 +631,11 @@ impl<T: ?Sized> Copy for &T {}
628
631
any( _Self = "core::cell::RefCell<T>" , _Self = "std::cell::RefCell<T>" ) ,
629
632
note = "if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead" ,
630
633
) ,
634
+ on( _Self = "std::rc::Rc<T, A>" , note = "use `std::sync::Arc` instead of `std::rc::Rc`" ) ,
631
635
message = "`{Self}` cannot be shared between threads safely" ,
632
- label = "`{Self}` cannot be shared between threads safely"
636
+ label = "`{Self}` cannot be shared between threads safely" ,
637
+ note = "consider using `std::sync::Arc<{Self}>`; for more information visit \
638
+ <https://doc.rust-lang.org/book/ch16-03-shared-state.html>"
633
639
) ]
634
640
pub unsafe auto trait Sync {
635
641
// FIXME(estebank): once support to add notes in `rustc_on_unimplemented`
0 commit comments