fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

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