Add rustc_on_unimplemented
on Sync
for cell types
Suggest using a lock instead.
This commit is contained in:
parent
e1f630f23d
commit
6d0c91fda3
18 changed files with 229 additions and 5 deletions
|
@ -5,6 +5,7 @@ LL | test::<Cell<i32>>();
|
|||
| ^^^^^^^^^ `Cell<i32>` cannot be shared between threads safely
|
||||
|
|
||||
= help: the trait `Sync` is not implemented for `Cell<i32>`
|
||||
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` or `std::sync::atomic::AtomicI32` instead
|
||||
note: required by a bound in `test`
|
||||
--> $DIR/not-sync.rs:5:12
|
||||
|
|
||||
|
@ -18,6 +19,7 @@ LL | test::<RefCell<i32>>();
|
|||
| ^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
|
||||
|
|
||||
= help: the trait `Sync` is not implemented for `RefCell<i32>`
|
||||
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
|
||||
note: required by a bound in `test`
|
||||
--> $DIR/not-sync.rs:5:12
|
||||
|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue