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