]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/auto-trait-leak2.stderr
Rollup merge of #89876 - AlexApps99:const_ops, r=oli-obk
[rust.git] / src / test / ui / impl-trait / auto-trait-leak2.stderr
1 error[E0277]: `Rc<Cell<i32>>` cannot be sent between threads safely
2   --> $DIR/auto-trait-leak2.rs:13:10
3    |
4 LL | fn before() -> impl Fn(i32) {
5    |                ------------ within this `impl Fn<(i32,)>`
6 ...
7 LL |     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>>`
13    = note: required because it appears within the type `[closure@$DIR/auto-trait-leak2.rs:7:5: 7:22]`
14    = note: required because it appears within the type `impl Fn<(i32,)>`
15 note: required by a bound in `send`
16   --> $DIR/auto-trait-leak2.rs:10:12
17    |
18 LL | fn send<T: Send>(_: T) {}
19    |            ^^^^ required by this bound in `send`
20
21 error[E0277]: `Rc<Cell<i32>>` cannot be sent between threads safely
22   --> $DIR/auto-trait-leak2.rs:16:10
23    |
24 LL |     send(after());
25    |     ---- ^^^^^^^ `Rc<Cell<i32>>` cannot be sent between threads safely
26    |     |
27    |     required by a bound introduced by this call
28 ...
29 LL | fn after() -> impl Fn(i32) {
30    |               ------------ within this `impl Fn<(i32,)>`
31    |
32    = help: within `impl Fn<(i32,)>`, the trait `Send` is not implemented for `Rc<Cell<i32>>`
33    = note: required because it appears within the type `[closure@$DIR/auto-trait-leak2.rs:24:5: 24:22]`
34    = note: required because it appears within the type `impl Fn<(i32,)>`
35 note: required by a bound in `send`
36   --> $DIR/auto-trait-leak2.rs:10:12
37    |
38 LL | fn send<T: Send>(_: T) {}
39    |            ^^^^ required by this bound in `send`
40
41 error: aborting due to 2 previous errors
42
43 For more information about this error, try `rustc --explain E0277`.