]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generator/issue-68112.stderr
Auto merge of #102655 - joboet:windows_tls_opt, r=ChrisDenton
[rust.git] / src / test / ui / generator / issue-68112.stderr
1 error: generator cannot be sent between threads safely
2   --> $DIR/issue-68112.rs:40:18
3    |
4 LL |     require_send(send_gen);
5    |                  ^^^^^^^^ generator is not `Send`
6    |
7    = help: the trait `Sync` is not implemented for `RefCell<i32>`
8 note: generator is not `Send` as this value is used across a yield
9   --> $DIR/issue-68112.rs:36:9
10    |
11 LL |         let _non_send_gen = make_non_send_generator();
12    |             ------------- has type `impl Generator<Return = Arc<RefCell<i32>>>` which is not `Send`
13 LL |
14 LL |         yield;
15    |         ^^^^^ yield occurs here, with `_non_send_gen` maybe used later
16 ...
17 LL |     };
18    |     - `_non_send_gen` is later dropped here
19 note: required by a bound in `require_send`
20   --> $DIR/issue-68112.rs:22:25
21    |
22 LL | fn require_send(_: impl Send) {}
23    |                         ^^^^ required by this bound in `require_send`
24
25 error[E0277]: `RefCell<i32>` cannot be shared between threads safely
26   --> $DIR/issue-68112.rs:63:18
27    |
28 LL |     require_send(send_gen);
29    |     ------------ ^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
30    |     |
31    |     required by a bound introduced by this call
32    |
33    = help: the trait `Sync` is not implemented for `RefCell<i32>`
34    = note: required for `Arc<RefCell<i32>>` to implement `Send`
35 note: required because it's used within this generator
36   --> $DIR/issue-68112.rs:48:5
37    |
38 LL |     || {
39    |     ^^
40 note: required because it appears within the type `impl Generator<Return = Arc<RefCell<i32>>>`
41   --> $DIR/issue-68112.rs:45:30
42    |
43 LL | pub fn make_gen2<T>(t: T) -> impl Generator<Return = T> {
44    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^
45 note: required because it appears within the type `impl Generator<Return = Arc<RefCell<i32>>>`
46   --> $DIR/issue-68112.rs:53:34
47    |
48 LL | fn make_non_send_generator2() -> impl Generator<Return = Arc<RefCell<i32>>> {
49    |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50    = note: required because it captures the following types: `impl Generator<Return = Arc<RefCell<i32>>>`, `()`
51 note: required because it's used within this generator
52   --> $DIR/issue-68112.rs:59:20
53    |
54 LL |     let send_gen = || {
55    |                    ^^
56 note: required by a bound in `require_send`
57   --> $DIR/issue-68112.rs:22:25
58    |
59 LL | fn require_send(_: impl Send) {}
60    |                         ^^^^ required by this bound in `require_send`
61
62 error: aborting due to 2 previous errors
63
64 For more information about this error, try `rustc --explain E0277`.