]> git.proxmox.com Git - rustc.git/blame - src/test/ui/impl-trait/auto-trait-leak2.stderr
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / impl-trait / auto-trait-leak2.stderr
CommitLineData
1b1a35ee 1error[E0277]: `Rc<Cell<i32>>` cannot be sent between threads safely
923072b8 2 --> $DIR/auto-trait-leak2.rs:20:10
94b46f34 3 |
dfeec247 4LL | fn before() -> impl Fn(i32) {
3c0e092e 5 | ------------ within this `impl Fn(i32)`
dfeec247 6...
94b46f34 7LL | send(before());
3c0e092e
XL
8 | ---- ^^^^^^^^ `Rc<Cell<i32>>` cannot be sent between threads safely
9 | |
10 | required by a bound introduced by this call
94b46f34 11 |
3c0e092e 12 = help: within `impl Fn(i32)`, the trait `Send` is not implemented for `Rc<Cell<i32>>`
923072b8
FG
13note: required because it's used within this closure
14 --> $DIR/auto-trait-leak2.rs:10:5
15 |
16LL | move |x| p.set(x)
064997fb 17 | ^^^^^^^^
923072b8
FG
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 | ^^^^^^^^^^^^
94222f64 23note: required by a bound in `send`
923072b8 24 --> $DIR/auto-trait-leak2.rs:13:12
94222f64
XL
25 |
26LL | fn send<T: Send>(_: T) {}
27 | ^^^^ required by this bound in `send`
94b46f34 28
1b1a35ee 29error[E0277]: `Rc<Cell<i32>>` cannot be sent between threads safely
923072b8 30 --> $DIR/auto-trait-leak2.rs:25:10
94b46f34
XL
31 |
32LL | send(after());
3c0e092e
XL
33 | ---- ^^^^^^^ `Rc<Cell<i32>>` cannot be sent between threads safely
34 | |
35 | required by a bound introduced by this call
dfeec247
XL
36...
37LL | fn after() -> impl Fn(i32) {
3c0e092e 38 | ------------ within this `impl Fn(i32)`
94b46f34 39 |
3c0e092e 40 = help: within `impl Fn(i32)`, the trait `Send` is not implemented for `Rc<Cell<i32>>`
923072b8
FG
41note: required because it's used within this closure
42 --> $DIR/auto-trait-leak2.rs:38:5
43 |
44LL | move |x| p.set(x)
064997fb 45 | ^^^^^^^^
923072b8
FG
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 | ^^^^^^^^^^^^
94222f64 51note: required by a bound in `send`
923072b8 52 --> $DIR/auto-trait-leak2.rs:13:12
94222f64
XL
53 |
54LL | fn send<T: Send>(_: T) {}
55 | ^^^^ required by this bound in `send`
94b46f34
XL
56
57error: aborting due to 2 previous errors
58
59For more information about this error, try `rustc --explain E0277`.