diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:41 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:41 +0000 |
commit | 4f9fe856a25ab29345b90e7725509e9ee38a37be (patch) | |
tree | e4ffd8a9374cae7b21f7cbfb352927e0e074aff6 /tests/ui/generator/issue-68112.drop_tracking.stderr | |
parent | Adding upstream version 1.68.2+dfsg1. (diff) | |
download | rustc-4f9fe856a25ab29345b90e7725509e9ee38a37be.tar.xz rustc-4f9fe856a25ab29345b90e7725509e9ee38a37be.zip |
Adding upstream version 1.69.0+dfsg1.upstream/1.69.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | tests/ui/generator/issue-68112.drop_tracking.stderr (renamed from tests/ui/generator/issue-68112.stderr) | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/tests/ui/generator/issue-68112.stderr b/tests/ui/generator/issue-68112.drop_tracking.stderr index eb99d42c9..282eac1b6 100644 --- a/tests/ui/generator/issue-68112.stderr +++ b/tests/ui/generator/issue-68112.drop_tracking.stderr @@ -1,12 +1,13 @@ error: generator cannot be sent between threads safely - --> $DIR/issue-68112.rs:40:18 + --> $DIR/issue-68112.rs:43:18 | LL | require_send(send_gen); | ^^^^^^^^ generator is not `Send` | = help: the trait `Sync` is not implemented for `RefCell<i32>` + = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead note: generator is not `Send` as this value is used across a yield - --> $DIR/issue-68112.rs:36:9 + --> $DIR/issue-68112.rs:39:9 | LL | let _non_send_gen = make_non_send_generator(); | ------------- has type `impl Generator<Return = Arc<RefCell<i32>>>` which is not `Send` @@ -17,13 +18,13 @@ LL | yield; LL | }; | - `_non_send_gen` is later dropped here note: required by a bound in `require_send` - --> $DIR/issue-68112.rs:22:25 + --> $DIR/issue-68112.rs:25:25 | LL | fn require_send(_: impl Send) {} | ^^^^ required by this bound in `require_send` error[E0277]: `RefCell<i32>` cannot be shared between threads safely - --> $DIR/issue-68112.rs:63:18 + --> $DIR/issue-68112.rs:67:18 | LL | require_send(send_gen); | ------------ ^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely @@ -31,30 +32,31 @@ LL | require_send(send_gen); | required by a bound introduced by this call | = help: the trait `Sync` is not implemented for `RefCell<i32>` + = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead = note: required for `Arc<RefCell<i32>>` to implement `Send` note: required because it's used within this generator - --> $DIR/issue-68112.rs:48:5 + --> $DIR/issue-68112.rs:52:5 | LL | || { | ^^ note: required because it appears within the type `impl Generator<Return = Arc<RefCell<i32>>>` - --> $DIR/issue-68112.rs:45:30 + --> $DIR/issue-68112.rs:49:30 | LL | pub fn make_gen2<T>(t: T) -> impl Generator<Return = T> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ note: required because it appears within the type `impl Generator<Return = Arc<RefCell<i32>>>` - --> $DIR/issue-68112.rs:53:34 + --> $DIR/issue-68112.rs:57:34 | LL | fn make_non_send_generator2() -> impl Generator<Return = Arc<RefCell<i32>>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: required because it captures the following types: `impl Generator<Return = Arc<RefCell<i32>>>`, `()` note: required because it's used within this generator - --> $DIR/issue-68112.rs:59:20 + --> $DIR/issue-68112.rs:63:20 | LL | let send_gen = || { | ^^ note: required by a bound in `require_send` - --> $DIR/issue-68112.rs:22:25 + --> $DIR/issue-68112.rs:25:25 | LL | fn require_send(_: impl Send) {} | ^^^^ required by this bound in `require_send` |