]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generator/issue-68112.stderr
Rollup merge of #100721 - JhonnyBillM:enable-diag-lint-in-type-ir, r=compiler-errors
[rust.git] / src / test / ui / generator / issue-68112.stderr
1 error: generator cannot be sent between threads safely
2   --> $DIR/issue-68112.rs:40:5
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:5
27    |
28 LL |     require_send(send_gen);
29    |     ^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
30    |
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
35    |
36 LL |     || {
37    |     ^^
38 note: required because it appears within the type `impl Generator<Return = Arc<RefCell<i32>>>`
39   --> $DIR/issue-68112.rs:45:30
40    |
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
45    |
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
51    |
52 LL |     let send_gen = || {
53    |                    ^^
54 note: required by a bound in `require_send`
55   --> $DIR/issue-68112.rs:22:25
56    |
57 LL | fn require_send(_: impl Send) {}
58    |                         ^^^^ required by this bound in `require_send`
59
60 error: aborting due to 2 previous errors
61
62 For more information about this error, try `rustc --explain E0277`.