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