fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.5 KiB70 linesraw
1error[E0277]: `Cell<i32>` cannot be shared between threads safely
2  --> $DIR/not-sync.rs:8:12
3   |
4LL |     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
9note: required by a bound in `test`
10  --> $DIR/not-sync.rs:5:12
11   |
12LL | fn test<T: Sync>() {}
13   |            ^^^^ required by this bound in `test`
14
15error[E0277]: `RefCell<i32>` cannot be shared between threads safely
16  --> $DIR/not-sync.rs:10:12
17   |
18LL |     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
23note: required by a bound in `test`
24  --> $DIR/not-sync.rs:5:12
25   |
26LL | fn test<T: Sync>() {}
27   |            ^^^^ required by this bound in `test`
28
29error[E0277]: `Rc<i32>` cannot be shared between threads safely
30  --> $DIR/not-sync.rs:13:12
31   |
32LL |     test::<Rc<i32>>();
33   |            ^^^^^^^ `Rc<i32>` cannot be shared between threads safely
34   |
35   = help: the trait `Sync` is not implemented for `Rc<i32>`
36note: required by a bound in `test`
37  --> $DIR/not-sync.rs:5:12
38   |
39LL | fn test<T: Sync>() {}
40   |            ^^^^ required by this bound in `test`
41
42error[E0277]: `std::rc::Weak<i32>` cannot be shared between threads safely
43  --> $DIR/not-sync.rs:15:12
44   |
45LL |     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>`
49note: required by a bound in `test`
50  --> $DIR/not-sync.rs:5:12
51   |
52LL | fn test<T: Sync>() {}
53   |            ^^^^ required by this bound in `test`
54
55error[E0277]: `std::sync::mpsc::Receiver<i32>` cannot be shared between threads safely
56  --> $DIR/not-sync.rs:18:12
57   |
58LL |     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>`
62note: required by a bound in `test`
63  --> $DIR/not-sync.rs:5:12
64   |
65LL | fn test<T: Sync>() {}
66   |            ^^^^ required by this bound in `test`
67
68error: aborting due to 5 previous errors
69
70For more information about this error, try `rustc --explain E0277`.