]> git.proxmox.com Git - rustc.git/blob - tests/ui/generator/print/generator-print-verbose-1.drop_tracking.stderr
New upstream version 1.69.0+dfsg1
[rustc.git] / tests / ui / generator / print / generator-print-verbose-1.drop_tracking.stderr
1 error: generator cannot be sent between threads safely
2 --> $DIR/generator-print-verbose-1.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: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
9 note: generator is not `Send` as this value is used across a yield
10 --> $DIR/generator-print-verbose-1.rs:38:9
11 |
12 LL | let _non_send_gen = make_non_send_generator();
13 | ------------- has type `Opaque(DefId(0:34 ~ generator_print_verbose_1[749a]::make_non_send_generator::{opaque#0}), [])` which is not `Send`
14 LL | yield;
15 | ^^^^^ yield occurs here, with `_non_send_gen` maybe used later
16 LL | };
17 | - `_non_send_gen` is later dropped here
18 note: required by a bound in `require_send`
19 --> $DIR/generator-print-verbose-1.rs:29:25
20 |
21 LL | fn require_send(_: impl Send) {}
22 | ^^^^ required by this bound in `require_send`
23
24 error[E0277]: `RefCell<i32>` cannot be shared between threads safely
25 --> $DIR/generator-print-verbose-1.rs:59:18
26 |
27 LL | require_send(send_gen);
28 | ------------ ^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
29 | |
30 | required by a bound introduced by this call
31 |
32 = help: the trait `Sync` is not implemented for `RefCell<i32>`
33 = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
34 = note: required for `Arc<RefCell<i32>>` to implement `Send`
35 note: required because it's used within this generator
36 --> $DIR/generator-print-verbose-1.rs:45:5
37 |
38 LL | || {
39 | ^^
40 note: required because it appears within the type `Opaque(DefId(0:35 ~ generator_print_verbose_1[749a]::make_gen2::{opaque#0}), [Arc<RefCell<i32>>])`
41 --> $DIR/generator-print-verbose-1.rs:44: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 `Opaque(DefId(0:36 ~ generator_print_verbose_1[749a]::make_non_send_generator2::{opaque#0}), [])`
46 --> $DIR/generator-print-verbose-1.rs:50: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: `Opaque(DefId(0:36 ~ generator_print_verbose_1[749a]::make_non_send_generator2::{opaque#0}), [])`, `()`
51 note: required because it's used within this generator
52 --> $DIR/generator-print-verbose-1.rs:55:20
53 |
54 LL | let send_gen = || {
55 | ^^
56 note: required by a bound in `require_send`
57 --> $DIR/generator-print-verbose-1.rs:29: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`.