1 error: generator cannot be sent between threads safely
2 --> $DIR/issue-68112.rs:40:5
4 LL | require_send(send_gen);
5 | ^^^^^^^^^^^^ generator is not `Send`
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
11 LL | let _non_send_gen = make_non_send_generator();
12 | ------------- has type `impl Generator<Return = Arc<RefCell<i32>>>` which is not `Send`
15 | ^^^^^ yield occurs here, with `_non_send_gen` maybe used later
18 | - `_non_send_gen` is later dropped here
19 note: required by a bound in `require_send`
20 --> $DIR/issue-68112.rs:22:25
22 LL | fn require_send(_: impl Send) {}
23 | ^^^^ required by this bound in `require_send`
25 error[E0277]: `RefCell<i32>` cannot be shared between threads safely
26 --> $DIR/issue-68112.rs:63:5
28 LL | require_send(send_gen);
29 | ^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
31 = help: the trait `Sync` is not implemented for `RefCell<i32>`
32 = note: required for `Arc<RefCell<i32>>` to implement `Send`
33 note: required because it's used within this generator
34 --> $DIR/issue-68112.rs:48:5
38 note: required because it appears within the type `impl Generator<Return = Arc<RefCell<i32>>>`
39 --> $DIR/issue-68112.rs:45:30
41 LL | pub fn make_gen2<T>(t: T) -> impl Generator<Return = T> {
42 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
43 note: required because it appears within the type `impl Generator<Return = Arc<RefCell<i32>>>`
44 --> $DIR/issue-68112.rs:53:34
46 LL | fn make_non_send_generator2() -> impl Generator<Return = Arc<RefCell<i32>>> {
47 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48 = note: required because it captures the following types: `impl Generator<Return = Arc<RefCell<i32>>>`, `()`
49 note: required because it's used within this generator
50 --> $DIR/issue-68112.rs:59:20
52 LL | let send_gen = || {
54 note: required by a bound in `require_send`
55 --> $DIR/issue-68112.rs:22:25
57 LL | fn require_send(_: impl Send) {}
58 | ^^^^ required by this bound in `require_send`
60 error: aborting due to 2 previous errors
62 For more information about this error, try `rustc --explain E0277`.