fork/rust

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

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

master
2.0 KiB59 linesraw
1error[E0277]: `Rc<Cell<i32>>` cannot be sent between threads safely
2  --> $DIR/auto-trait-leak2.rs:20:10
3   |
4LL | fn before() -> impl Fn(i32) {
5   |                ------------ within this `impl Fn(i32)`
6...
7LL |     send(before());
8   |     ---- ^^^^^^^^ `Rc<Cell<i32>>` cannot be sent between threads safely
9   |     |
10   |     required by a bound introduced by this call
11   |
12   = help: within `impl Fn(i32)`, the trait `Send` is not implemented for `Rc<Cell<i32>>`
13note: required because it's used within this closure
14  --> $DIR/auto-trait-leak2.rs:10:5
15   |
16LL |     move |x| p.set(x)
17   |     ^^^^^^^^
18note: required because it appears within the type `impl Fn(i32)`
19  --> $DIR/auto-trait-leak2.rs:5:16
20   |
21LL | fn before() -> impl Fn(i32) {
22   |                ^^^^^^^^^^^^
23note: required by a bound in `send`
24  --> $DIR/auto-trait-leak2.rs:13:12
25   |
26LL | fn send<T: Send>(_: T) {}
27   |            ^^^^ required by this bound in `send`
28
29error[E0277]: `Rc<Cell<i32>>` cannot be sent between threads safely
30  --> $DIR/auto-trait-leak2.rs:25:10
31   |
32LL |     send(after());
33   |     ---- ^^^^^^^ `Rc<Cell<i32>>` cannot be sent between threads safely
34   |     |
35   |     required by a bound introduced by this call
36...
37LL | fn after() -> impl Fn(i32) {
38   |               ------------ within this `impl Fn(i32)`
39   |
40   = help: within `impl Fn(i32)`, the trait `Send` is not implemented for `Rc<Cell<i32>>`
41note: required because it's used within this closure
42  --> $DIR/auto-trait-leak2.rs:38:5
43   |
44LL |     move |x| p.set(x)
45   |     ^^^^^^^^
46note: required because it appears within the type `impl Fn(i32)`
47  --> $DIR/auto-trait-leak2.rs:33:15
48   |
49LL | fn after() -> impl Fn(i32) {
50   |               ^^^^^^^^^^^^
51note: required by a bound in `send`
52  --> $DIR/auto-trait-leak2.rs:13:12
53   |
54LL | fn send<T: Send>(_: T) {}
55   |            ^^^^ required by this bound in `send`
56
57error: aborting due to 2 previous errors
58
59For more information about this error, try `rustc --explain E0277`.