]> git.proxmox.com Git - rustc.git/blob - tests/ui/generator/partial-drop.no_drop_tracking.stderr
New upstream version 1.73.0+dfsg1
[rustc.git] / tests / ui / generator / partial-drop.no_drop_tracking.stderr
1 error: generator cannot be sent between threads safely
2 --> $DIR/partial-drop.rs:17:17
3 |
4 LL | assert_send(|| {
5 | _________________^
6 LL | |
7 LL | | let guard = Bar { foo: Foo, x: 42 };
8 LL | | drop(guard.foo);
9 LL | | yield;
10 LL | | });
11 | |_____^ generator is not `Send`
12 |
13 = help: within `[generator@$DIR/partial-drop.rs:17:17: 17:19]`, the trait `Send` is not implemented for `Foo`
14 note: generator is not `Send` as this value is used across a yield
15 --> $DIR/partial-drop.rs:21:9
16 |
17 LL | let guard = Bar { foo: Foo, x: 42 };
18 | ----- has type `Bar` which is not `Send`
19 LL | drop(guard.foo);
20 LL | yield;
21 | ^^^^^ yield occurs here, with `guard` maybe used later
22 LL | });
23 | - `guard` is later dropped here
24 note: required by a bound in `assert_send`
25 --> $DIR/partial-drop.rs:33:19
26 |
27 LL | fn assert_send<T: Send>(_: T) {}
28 | ^^^^ required by this bound in `assert_send`
29
30 error: generator cannot be sent between threads safely
31 --> $DIR/partial-drop.rs:24:17
32 |
33 LL | assert_send(|| {
34 | _________________^
35 LL | |
36 LL | | let guard = Bar { foo: Foo, x: 42 };
37 LL | | let Bar { foo, x } = guard;
38 LL | | drop(foo);
39 LL | | yield;
40 LL | | });
41 | |_____^ generator is not `Send`
42 |
43 = help: within `[generator@$DIR/partial-drop.rs:24:17: 24:19]`, the trait `Send` is not implemented for `Foo`
44 note: generator is not `Send` as this value is used across a yield
45 --> $DIR/partial-drop.rs:29:9
46 |
47 LL | let Bar { foo, x } = guard;
48 | --- has type `Foo` which is not `Send`
49 LL | drop(foo);
50 LL | yield;
51 | ^^^^^ yield occurs here, with `foo` maybe used later
52 LL | });
53 | - `foo` is later dropped here
54 note: required by a bound in `assert_send`
55 --> $DIR/partial-drop.rs:33:19
56 |
57 LL | fn assert_send<T: Send>(_: T) {}
58 | ^^^^ required by this bound in `assert_send`
59
60 error: aborting due to 2 previous errors
61