]> git.lizzy.rs Git - rust.git/blob - tests/ui/stdlib-unit-tests/not-sync.stderr
Add `rustc_on_unimplemented` on `Sync` for cell types
[rust.git] / tests / ui / stdlib-unit-tests / not-sync.stderr
1 error[E0277]: `Cell<i32>` cannot be shared between threads safely
2   --> $DIR/not-sync.rs:8:12
3    |
4 LL |     test::<Cell<i32>>();
5    |            ^^^^^^^^^ `Cell<i32>` cannot be shared between threads safely
6    |
7    = help: the trait `Sync` is not implemented for `Cell<i32>`
8    = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` or `std::sync::atomic::AtomicI32` instead
9 note: required by a bound in `test`
10   --> $DIR/not-sync.rs:5:12
11    |
12 LL | fn test<T: Sync>() {}
13    |            ^^^^ required by this bound in `test`
14
15 error[E0277]: `RefCell<i32>` cannot be shared between threads safely
16   --> $DIR/not-sync.rs:10:12
17    |
18 LL |     test::<RefCell<i32>>();
19    |            ^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
20    |
21    = help: the trait `Sync` is not implemented for `RefCell<i32>`
22    = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
23 note: required by a bound in `test`
24   --> $DIR/not-sync.rs:5:12
25    |
26 LL | fn test<T: Sync>() {}
27    |            ^^^^ required by this bound in `test`
28
29 error[E0277]: `Rc<i32>` cannot be shared between threads safely
30   --> $DIR/not-sync.rs:13:12
31    |
32 LL |     test::<Rc<i32>>();
33    |            ^^^^^^^ `Rc<i32>` cannot be shared between threads safely
34    |
35    = help: the trait `Sync` is not implemented for `Rc<i32>`
36 note: required by a bound in `test`
37   --> $DIR/not-sync.rs:5:12
38    |
39 LL | fn test<T: Sync>() {}
40    |            ^^^^ required by this bound in `test`
41
42 error[E0277]: `std::rc::Weak<i32>` cannot be shared between threads safely
43   --> $DIR/not-sync.rs:15:12
44    |
45 LL |     test::<Weak<i32>>();
46    |            ^^^^^^^^^ `std::rc::Weak<i32>` cannot be shared between threads safely
47    |
48    = help: the trait `Sync` is not implemented for `std::rc::Weak<i32>`
49 note: required by a bound in `test`
50   --> $DIR/not-sync.rs:5:12
51    |
52 LL | fn test<T: Sync>() {}
53    |            ^^^^ required by this bound in `test`
54
55 error[E0277]: `std::sync::mpsc::Receiver<i32>` cannot be shared between threads safely
56   --> $DIR/not-sync.rs:18:12
57    |
58 LL |     test::<Receiver<i32>>();
59    |            ^^^^^^^^^^^^^ `std::sync::mpsc::Receiver<i32>` cannot be shared between threads safely
60    |
61    = help: the trait `Sync` is not implemented for `std::sync::mpsc::Receiver<i32>`
62 note: required by a bound in `test`
63   --> $DIR/not-sync.rs:5:12
64    |
65 LL | fn test<T: Sync>() {}
66    |            ^^^^ required by this bound in `test`
67
68 error[E0277]: `Sender<i32>` cannot be shared between threads safely
69   --> $DIR/not-sync.rs:20:12
70    |
71 LL |     test::<Sender<i32>>();
72    |            ^^^^^^^^^^^ `Sender<i32>` cannot be shared between threads safely
73    |
74    = help: the trait `Sync` is not implemented for `Sender<i32>`
75 note: required by a bound in `test`
76   --> $DIR/not-sync.rs:5:12
77    |
78 LL | fn test<T: Sync>() {}
79    |            ^^^^ required by this bound in `test`
80
81 error: aborting due to 6 previous errors
82
83 For more information about this error, try `rustc --explain E0277`.