]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generator/drop-yield-twice.stderr
Auto merge of #102655 - joboet:windows_tls_opt, r=ChrisDenton
[rust.git] / src / test / ui / generator / drop-yield-twice.stderr
1 error: generator cannot be sent between threads safely
2   --> $DIR/drop-yield-twice.rs:7:17
3    |
4 LL |       assert_send(|| {
5    |  _________________^
6 LL | |         let guard = Foo(42);
7 LL | |         yield;
8 LL | |         drop(guard);
9 LL | |         yield;
10 LL | |     })
11    | |_____^ generator is not `Send`
12    |
13    = help: within `[generator@$DIR/drop-yield-twice.rs:7:17: 7: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/drop-yield-twice.rs:9:9
16    |
17 LL |         let guard = Foo(42);
18    |             ----- has type `Foo` which is not `Send`
19 LL |         yield;
20    |         ^^^^^ yield occurs here, with `guard` maybe used later
21 ...
22 LL |     })
23    |     - `guard` is later dropped here
24 note: required by a bound in `assert_send`
25   --> $DIR/drop-yield-twice.rs:15:19
26    |
27 LL | fn assert_send<T: Send>(_: T) {}
28    |                   ^^^^ required by this bound in `assert_send`
29
30 error: aborting due to previous error
31