|
| 1 | +error: generator cannot be sent between threads safely |
| 2 | + --> $DIR/generator-print-1.rs:35:5 |
| 3 | + | |
| 4 | +LL | fn require_send(_: impl Send) {} |
| 5 | + | ---- required by this bound in `require_send` |
| 6 | +... |
| 7 | +LL | require_send(send_gen); |
| 8 | + | ^^^^^^^^^^^^ generator is not `Send` |
| 9 | + | |
| 10 | + = help: the trait `Sync` is not implemented for `RefCell<i32>` |
| 11 | +note: generator is not `Send` as this value is used across a yield |
| 12 | + --> $DIR/generator-print-1.rs:33:9 |
| 13 | + | |
| 14 | +LL | let _non_send_gen = make_non_send_generator(); |
| 15 | + | ------------- has type `impl Generator` which is not `Send` |
| 16 | +LL | yield; |
| 17 | + | ^^^^^ yield occurs here, with `_non_send_gen` maybe used later |
| 18 | +LL | }; |
| 19 | + | - `_non_send_gen` is later dropped here |
| 20 | + |
| 21 | +error[E0277]: `RefCell<i32>` cannot be shared between threads safely |
| 22 | + --> $DIR/generator-print-1.rs:54:5 |
| 23 | + | |
| 24 | +LL | fn require_send(_: impl Send) {} |
| 25 | + | ---- required by this bound in `require_send` |
| 26 | +... |
| 27 | +LL | require_send(send_gen); |
| 28 | + | ^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely |
| 29 | + | |
| 30 | + = help: the trait `Sync` is not implemented for `RefCell<i32>` |
| 31 | + = note: required because of the requirements on the impl of `Send` for `Arc<RefCell<i32>>` |
| 32 | + = note: required because it appears within the type `[generator@$DIR/generator-print-1.rs:40:5: 43:6 {()}]` |
| 33 | + = note: required because it appears within the type `impl Generator` |
| 34 | + = note: required because it appears within the type `impl Generator` |
| 35 | + = note: required because it appears within the type `{impl Generator, ()}` |
| 36 | + = note: required because it appears within the type `[generator@$DIR/generator-print-1.rs:50:20: 53:6 {impl Generator, ()}]` |
| 37 | + |
| 38 | +error: aborting due to 2 previous errors |
| 39 | + |
| 40 | +For more information about this error, try `rustc --explain E0277`. |
0 commit comments