From 94a0819fe3a0d679c3042a77bfe6a2afc505daea Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:28 +0200 Subject: Adding upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/generator/clone-impl-async.rs | 71 +++++++++ src/test/ui/generator/clone-impl-async.stderr | 171 +++++++++++++++++++++ src/test/ui/generator/clone-impl-static.rs | 17 ++ src/test/ui/generator/clone-impl-static.stderr | 31 ++++ src/test/ui/generator/clone-impl.rs | 73 +++++++++ src/test/ui/generator/clone-impl.stderr | 142 +++++++++++++++++ .../drop-tracking-parent-expression.stderr | 12 +- src/test/ui/generator/drop-yield-twice.stderr | 12 +- .../generator-yielding-or-returning-itself.stderr | 26 +++- src/test/ui/generator/issue-102645.rs | 23 +++ src/test/ui/generator/issue-102645.stderr | 19 +++ src/test/ui/generator/issue-52398.stderr | 2 +- src/test/ui/generator/issue-57084.stderr | 2 +- src/test/ui/generator/issue-68112.rs | 3 +- src/test/ui/generator/issue-68112.stderr | 12 +- src/test/ui/generator/match-bindings.stderr | 2 +- src/test/ui/generator/not-send-sync.stderr | 28 +++- src/test/ui/generator/panic-drops-resume.rs | 2 - src/test/ui/generator/panic-drops.rs | 1 - src/test/ui/generator/panic-safe.rs | 1 - src/test/ui/generator/partial-drop.stderr | 39 +++-- .../print/generator-print-verbose-1.stderr | 20 +-- .../print/generator-print-verbose-2.stderr | 28 +++- src/test/ui/generator/reborrow-mut-upvar.stderr | 2 +- src/test/ui/generator/resume-after-return.rs | 1 - src/test/ui/generator/size-moved-locals.rs | 1 + .../too-live-local-in-immovable-gen.stderr | 2 +- .../type-mismatch-signature-deduction.stderr | 6 + src/test/ui/generator/yield-in-args-rev.stderr | 2 +- src/test/ui/generator/yield-in-box.stderr | 2 +- src/test/ui/generator/yield-in-initializer.stderr | 2 +- .../yield-outside-generator-issue-78653.stderr | 2 +- src/test/ui/generator/yield-subtype.stderr | 2 +- 33 files changed, 689 insertions(+), 70 deletions(-) create mode 100644 src/test/ui/generator/clone-impl-async.rs create mode 100644 src/test/ui/generator/clone-impl-async.stderr create mode 100644 src/test/ui/generator/clone-impl-static.rs create mode 100644 src/test/ui/generator/clone-impl-static.stderr create mode 100644 src/test/ui/generator/clone-impl.rs create mode 100644 src/test/ui/generator/clone-impl.stderr create mode 100644 src/test/ui/generator/issue-102645.rs create mode 100644 src/test/ui/generator/issue-102645.stderr (limited to 'src/test/ui/generator') diff --git a/src/test/ui/generator/clone-impl-async.rs b/src/test/ui/generator/clone-impl-async.rs new file mode 100644 index 000000000..83c51526b --- /dev/null +++ b/src/test/ui/generator/clone-impl-async.rs @@ -0,0 +1,71 @@ +// edition:2021 +// gate-test-generator_clone +// Verifies that feature(generator_clone) doesn't allow async blocks to be cloned/copied. + +#![feature(generators, generator_clone)] + +use std::future::ready; + +struct NonClone; + +fn main() { + let inner_non_clone = async { + let non_clone = NonClone; + let () = ready(()).await; + drop(non_clone); + }; + check_copy(&inner_non_clone); + //~^ ERROR the trait bound `impl Future: Copy` is not satisfied + check_clone(&inner_non_clone); + //~^ ERROR the trait bound `impl Future: Clone` is not satisfied + + let non_clone = NonClone; + let outer_non_clone = async move { + drop(non_clone); + }; + check_copy(&outer_non_clone); + //~^ ERROR the trait bound `impl Future: Copy` is not satisfied + check_clone(&outer_non_clone); + //~^ ERROR the trait bound `impl Future: Clone` is not satisfied + + let maybe_copy_clone = async move {}; + check_copy(&maybe_copy_clone); + //~^ ERROR the trait bound `impl Future: Copy` is not satisfied + check_clone(&maybe_copy_clone); + //~^ ERROR the trait bound `impl Future: Clone` is not satisfied + + let inner_non_clone_fn = the_inner_non_clone_fn(); + check_copy(&inner_non_clone_fn); + //~^ ERROR the trait bound `impl Future: Copy` is not satisfied + check_clone(&inner_non_clone_fn); + //~^ ERROR the trait bound `impl Future: Clone` is not satisfied + + let outer_non_clone_fn = the_outer_non_clone_fn(NonClone); + check_copy(&outer_non_clone_fn); + //~^ ERROR the trait bound `impl Future: Copy` is not satisfied + check_clone(&outer_non_clone_fn); + //~^ ERROR the trait bound `impl Future: Clone` is not satisfied + + let maybe_copy_clone_fn = the_maybe_copy_clone_fn(); + check_copy(&maybe_copy_clone_fn); + //~^ ERROR the trait bound `impl Future: Copy` is not satisfied + check_clone(&maybe_copy_clone_fn); + //~^ ERROR the trait bound `impl Future: Clone` is not satisfied +} + +async fn the_inner_non_clone_fn() { + let non_clone = NonClone; + let () = ready(()).await; + drop(non_clone); +} + +async fn the_outer_non_clone_fn(non_clone: NonClone) { + let () = ready(()).await; + drop(non_clone); +} + +async fn the_maybe_copy_clone_fn() { +} + +fn check_copy(_x: &T) {} +fn check_clone(_x: &T) {} diff --git a/src/test/ui/generator/clone-impl-async.stderr b/src/test/ui/generator/clone-impl-async.stderr new file mode 100644 index 000000000..cbb58d2af --- /dev/null +++ b/src/test/ui/generator/clone-impl-async.stderr @@ -0,0 +1,171 @@ +error[E0277]: the trait bound `impl Future: Copy` is not satisfied + --> $DIR/clone-impl-async.rs:17:16 + | +LL | check_copy(&inner_non_clone); + | ---------- ^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `impl Future` + | | + | required by a bound introduced by this call + | +note: required by a bound in `check_copy` + --> $DIR/clone-impl-async.rs:70:18 + | +LL | fn check_copy(_x: &T) {} + | ^^^^ required by this bound in `check_copy` + +error[E0277]: the trait bound `impl Future: Clone` is not satisfied + --> $DIR/clone-impl-async.rs:19:17 + | +LL | check_clone(&inner_non_clone); + | ----------- ^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `impl Future` + | | + | required by a bound introduced by this call + | +note: required by a bound in `check_clone` + --> $DIR/clone-impl-async.rs:71:19 + | +LL | fn check_clone(_x: &T) {} + | ^^^^^ required by this bound in `check_clone` + +error[E0277]: the trait bound `impl Future: Copy` is not satisfied + --> $DIR/clone-impl-async.rs:26:16 + | +LL | check_copy(&outer_non_clone); + | ---------- ^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `impl Future` + | | + | required by a bound introduced by this call + | +note: required by a bound in `check_copy` + --> $DIR/clone-impl-async.rs:70:18 + | +LL | fn check_copy(_x: &T) {} + | ^^^^ required by this bound in `check_copy` + +error[E0277]: the trait bound `impl Future: Clone` is not satisfied + --> $DIR/clone-impl-async.rs:28:17 + | +LL | check_clone(&outer_non_clone); + | ----------- ^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `impl Future` + | | + | required by a bound introduced by this call + | +note: required by a bound in `check_clone` + --> $DIR/clone-impl-async.rs:71:19 + | +LL | fn check_clone(_x: &T) {} + | ^^^^^ required by this bound in `check_clone` + +error[E0277]: the trait bound `impl Future: Copy` is not satisfied + --> $DIR/clone-impl-async.rs:32:16 + | +LL | check_copy(&maybe_copy_clone); + | ---------- ^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `impl Future` + | | + | required by a bound introduced by this call + | +note: required by a bound in `check_copy` + --> $DIR/clone-impl-async.rs:70:18 + | +LL | fn check_copy(_x: &T) {} + | ^^^^ required by this bound in `check_copy` + +error[E0277]: the trait bound `impl Future: Clone` is not satisfied + --> $DIR/clone-impl-async.rs:34:17 + | +LL | check_clone(&maybe_copy_clone); + | ----------- ^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `impl Future` + | | + | required by a bound introduced by this call + | +note: required by a bound in `check_clone` + --> $DIR/clone-impl-async.rs:71:19 + | +LL | fn check_clone(_x: &T) {} + | ^^^^^ required by this bound in `check_clone` + +error[E0277]: the trait bound `impl Future: Copy` is not satisfied + --> $DIR/clone-impl-async.rs:38:16 + | +LL | check_copy(&inner_non_clone_fn); + | ---------- ^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `impl Future` + | | + | required by a bound introduced by this call + | +note: required by a bound in `check_copy` + --> $DIR/clone-impl-async.rs:70:18 + | +LL | fn check_copy(_x: &T) {} + | ^^^^ required by this bound in `check_copy` + +error[E0277]: the trait bound `impl Future: Clone` is not satisfied + --> $DIR/clone-impl-async.rs:40:17 + | +LL | check_clone(&inner_non_clone_fn); + | ----------- ^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `impl Future` + | | + | required by a bound introduced by this call + | +note: required by a bound in `check_clone` + --> $DIR/clone-impl-async.rs:71:19 + | +LL | fn check_clone(_x: &T) {} + | ^^^^^ required by this bound in `check_clone` + +error[E0277]: the trait bound `impl Future: Copy` is not satisfied + --> $DIR/clone-impl-async.rs:44:16 + | +LL | check_copy(&outer_non_clone_fn); + | ---------- ^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `impl Future` + | | + | required by a bound introduced by this call + | +note: required by a bound in `check_copy` + --> $DIR/clone-impl-async.rs:70:18 + | +LL | fn check_copy(_x: &T) {} + | ^^^^ required by this bound in `check_copy` + +error[E0277]: the trait bound `impl Future: Clone` is not satisfied + --> $DIR/clone-impl-async.rs:46:17 + | +LL | check_clone(&outer_non_clone_fn); + | ----------- ^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `impl Future` + | | + | required by a bound introduced by this call + | +note: required by a bound in `check_clone` + --> $DIR/clone-impl-async.rs:71:19 + | +LL | fn check_clone(_x: &T) {} + | ^^^^^ required by this bound in `check_clone` + +error[E0277]: the trait bound `impl Future: Copy` is not satisfied + --> $DIR/clone-impl-async.rs:50:16 + | +LL | check_copy(&maybe_copy_clone_fn); + | ---------- ^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `impl Future` + | | + | required by a bound introduced by this call + | +note: required by a bound in `check_copy` + --> $DIR/clone-impl-async.rs:70:18 + | +LL | fn check_copy(_x: &T) {} + | ^^^^ required by this bound in `check_copy` + +error[E0277]: the trait bound `impl Future: Clone` is not satisfied + --> $DIR/clone-impl-async.rs:52:17 + | +LL | check_clone(&maybe_copy_clone_fn); + | ----------- ^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `impl Future` + | | + | required by a bound introduced by this call + | +note: required by a bound in `check_clone` + --> $DIR/clone-impl-async.rs:71:19 + | +LL | fn check_clone(_x: &T) {} + | ^^^^^ required by this bound in `check_clone` + +error: aborting due to 12 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/generator/clone-impl-static.rs b/src/test/ui/generator/clone-impl-static.rs new file mode 100644 index 000000000..55ed0f281 --- /dev/null +++ b/src/test/ui/generator/clone-impl-static.rs @@ -0,0 +1,17 @@ +// gate-test-generator_clone +// Verifies that static generators cannot be cloned/copied. + +#![feature(generators, generator_clone)] + +fn main() { + let gen = static move || { + yield; + }; + check_copy(&gen); + //~^ ERROR Copy` is not satisfied + check_clone(&gen); + //~^ ERROR Clone` is not satisfied +} + +fn check_copy(_x: &T) {} +fn check_clone(_x: &T) {} diff --git a/src/test/ui/generator/clone-impl-static.stderr b/src/test/ui/generator/clone-impl-static.stderr new file mode 100644 index 000000000..cbadf6f15 --- /dev/null +++ b/src/test/ui/generator/clone-impl-static.stderr @@ -0,0 +1,31 @@ +error[E0277]: the trait bound `[static generator@$DIR/clone-impl-static.rs:7:15: 7:29]: Copy` is not satisfied + --> $DIR/clone-impl-static.rs:10:16 + | +LL | check_copy(&gen); + | ---------- ^^^^ the trait `Copy` is not implemented for `[static generator@$DIR/clone-impl-static.rs:7:15: 7:29]` + | | + | required by a bound introduced by this call + | +note: required by a bound in `check_copy` + --> $DIR/clone-impl-static.rs:16:18 + | +LL | fn check_copy(_x: &T) {} + | ^^^^ required by this bound in `check_copy` + +error[E0277]: the trait bound `[static generator@$DIR/clone-impl-static.rs:7:15: 7:29]: Clone` is not satisfied + --> $DIR/clone-impl-static.rs:12:17 + | +LL | check_clone(&gen); + | ----------- ^^^^ the trait `Clone` is not implemented for `[static generator@$DIR/clone-impl-static.rs:7:15: 7:29]` + | | + | required by a bound introduced by this call + | +note: required by a bound in `check_clone` + --> $DIR/clone-impl-static.rs:17:19 + | +LL | fn check_clone(_x: &T) {} + | ^^^^^ required by this bound in `check_clone` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/generator/clone-impl.rs b/src/test/ui/generator/clone-impl.rs new file mode 100644 index 000000000..cbfd65a53 --- /dev/null +++ b/src/test/ui/generator/clone-impl.rs @@ -0,0 +1,73 @@ +// gate-test-generator_clone +// Verifies that non-static generators can be cloned/copied if all their upvars and locals held +// across awaits can be cloned/copied. + +#![feature(generators, generator_clone)] + +struct NonClone; + +fn main() { + let copyable: u32 = 123; + let clonable_0: Vec = Vec::new(); + let clonable_1: Vec = Vec::new(); + let non_clonable: NonClone = NonClone; + + let gen_copy_0 = move || { + yield; + drop(copyable); + }; + check_copy(&gen_copy_0); + check_clone(&gen_copy_0); + let gen_copy_1 = move || { + /* + let v = vec!['a']; + let n = NonClone; + drop(v); + drop(n); + */ + yield; + let v = vec!['a']; + let n = NonClone; + drop(n); + drop(copyable); + }; + check_copy(&gen_copy_1); + check_clone(&gen_copy_1); + let gen_clone_0 = move || { + let v = vec!['a']; + yield; + drop(v); + drop(clonable_0); + }; + check_copy(&gen_clone_0); + //~^ ERROR the trait bound `Vec: Copy` is not satisfied + //~| ERROR the trait bound `Vec: Copy` is not satisfied + check_clone(&gen_clone_0); + let gen_clone_1 = move || { + let v = vec!['a']; + /* + let n = NonClone; + drop(n); + */ + yield; + let n = NonClone; + drop(n); + drop(v); + drop(clonable_1); + }; + check_copy(&gen_clone_1); + //~^ ERROR the trait bound `Vec: Copy` is not satisfied + //~| ERROR the trait bound `Vec: Copy` is not satisfied + check_clone(&gen_clone_1); + let gen_non_clone = move || { + yield; + drop(non_clonable); + }; + check_copy(&gen_non_clone); + //~^ ERROR the trait bound `NonClone: Copy` is not satisfied + check_clone(&gen_non_clone); + //~^ ERROR the trait bound `NonClone: Clone` is not satisfied +} + +fn check_copy(_x: &T) {} +fn check_clone(_x: &T) {} diff --git a/src/test/ui/generator/clone-impl.stderr b/src/test/ui/generator/clone-impl.stderr new file mode 100644 index 000000000..a92646b19 --- /dev/null +++ b/src/test/ui/generator/clone-impl.stderr @@ -0,0 +1,142 @@ +error[E0277]: the trait bound `Vec: Copy` is not satisfied in `[generator@$DIR/clone-impl.rs:36:23: 36:30]` + --> $DIR/clone-impl.rs:42:16 + | +LL | let gen_clone_0 = move || { + | ------- within this `[generator@$DIR/clone-impl.rs:36:23: 36:30]` +... +LL | check_copy(&gen_clone_0); + | ^^^^^^^^^^^^ within `[generator@$DIR/clone-impl.rs:36:23: 36:30]`, the trait `Copy` is not implemented for `Vec` + | +note: captured value does not implement `Copy` + --> $DIR/clone-impl.rs:40:14 + | +LL | drop(clonable_0); + | ^^^^^^^^^^ has type `Vec` which does not implement `Copy` +note: required by a bound in `check_copy` + --> $DIR/clone-impl.rs:72:18 + | +LL | fn check_copy(_x: &T) {} + | ^^^^ required by this bound in `check_copy` + +error[E0277]: the trait bound `Vec: Copy` is not satisfied in `[generator@$DIR/clone-impl.rs:36:23: 36:30]` + --> $DIR/clone-impl.rs:42:16 + | +LL | let gen_clone_0 = move || { + | ------- within this `[generator@$DIR/clone-impl.rs:36:23: 36:30]` +... +LL | check_copy(&gen_clone_0); + | ^^^^^^^^^^^^ within `[generator@$DIR/clone-impl.rs:36:23: 36:30]`, the trait `Copy` is not implemented for `Vec` + | +note: generator does not implement `Copy` as this value is used across a yield + --> $DIR/clone-impl.rs:38:9 + | +LL | let v = vec!['a']; + | - has type `Vec` which does not implement `Copy` +LL | yield; + | ^^^^^ yield occurs here, with `v` maybe used later +... +LL | }; + | - `v` is later dropped here +note: required by a bound in `check_copy` + --> $DIR/clone-impl.rs:72:18 + | +LL | fn check_copy(_x: &T) {} + | ^^^^ required by this bound in `check_copy` + +error[E0277]: the trait bound `Vec: Copy` is not satisfied in `[generator@$DIR/clone-impl.rs:46:23: 46:30]` + --> $DIR/clone-impl.rs:58:16 + | +LL | let gen_clone_1 = move || { + | ------- within this `[generator@$DIR/clone-impl.rs:46:23: 46:30]` +... +LL | check_copy(&gen_clone_1); + | ^^^^^^^^^^^^ within `[generator@$DIR/clone-impl.rs:46:23: 46:30]`, the trait `Copy` is not implemented for `Vec` + | +note: captured value does not implement `Copy` + --> $DIR/clone-impl.rs:56:14 + | +LL | drop(clonable_1); + | ^^^^^^^^^^ has type `Vec` which does not implement `Copy` +note: required by a bound in `check_copy` + --> $DIR/clone-impl.rs:72:18 + | +LL | fn check_copy(_x: &T) {} + | ^^^^ required by this bound in `check_copy` + +error[E0277]: the trait bound `Vec: Copy` is not satisfied in `[generator@$DIR/clone-impl.rs:46:23: 46:30]` + --> $DIR/clone-impl.rs:58:16 + | +LL | let gen_clone_1 = move || { + | ------- within this `[generator@$DIR/clone-impl.rs:46:23: 46:30]` +... +LL | check_copy(&gen_clone_1); + | ^^^^^^^^^^^^ within `[generator@$DIR/clone-impl.rs:46:23: 46:30]`, the trait `Copy` is not implemented for `Vec` + | +note: generator does not implement `Copy` as this value is used across a yield + --> $DIR/clone-impl.rs:52:9 + | +LL | let v = vec!['a']; + | - has type `Vec` which does not implement `Copy` +... +LL | yield; + | ^^^^^ yield occurs here, with `v` maybe used later +... +LL | }; + | - `v` is later dropped here +note: required by a bound in `check_copy` + --> $DIR/clone-impl.rs:72:18 + | +LL | fn check_copy(_x: &T) {} + | ^^^^ required by this bound in `check_copy` + +error[E0277]: the trait bound `NonClone: Copy` is not satisfied in `[generator@$DIR/clone-impl.rs:62:25: 62:32]` + --> $DIR/clone-impl.rs:66:16 + | +LL | let gen_non_clone = move || { + | ------- within this `[generator@$DIR/clone-impl.rs:62:25: 62:32]` +... +LL | check_copy(&gen_non_clone); + | ^^^^^^^^^^^^^^ within `[generator@$DIR/clone-impl.rs:62:25: 62:32]`, the trait `Copy` is not implemented for `NonClone` + | +note: captured value does not implement `Copy` + --> $DIR/clone-impl.rs:64:14 + | +LL | drop(non_clonable); + | ^^^^^^^^^^^^ has type `NonClone` which does not implement `Copy` +note: required by a bound in `check_copy` + --> $DIR/clone-impl.rs:72:18 + | +LL | fn check_copy(_x: &T) {} + | ^^^^ required by this bound in `check_copy` +help: consider annotating `NonClone` with `#[derive(Copy)]` + | +LL | #[derive(Copy)] + | + +error[E0277]: the trait bound `NonClone: Clone` is not satisfied in `[generator@$DIR/clone-impl.rs:62:25: 62:32]` + --> $DIR/clone-impl.rs:68:17 + | +LL | let gen_non_clone = move || { + | ------- within this `[generator@$DIR/clone-impl.rs:62:25: 62:32]` +... +LL | check_clone(&gen_non_clone); + | ^^^^^^^^^^^^^^ within `[generator@$DIR/clone-impl.rs:62:25: 62:32]`, the trait `Clone` is not implemented for `NonClone` + | +note: captured value does not implement `Clone` + --> $DIR/clone-impl.rs:64:14 + | +LL | drop(non_clonable); + | ^^^^^^^^^^^^ has type `NonClone` which does not implement `Clone` +note: required by a bound in `check_clone` + --> $DIR/clone-impl.rs:73:19 + | +LL | fn check_clone(_x: &T) {} + | ^^^^^ required by this bound in `check_clone` +help: consider annotating `NonClone` with `#[derive(Clone)]` + | +LL | #[derive(Clone)] + | + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/generator/drop-tracking-parent-expression.stderr b/src/test/ui/generator/drop-tracking-parent-expression.stderr index 522a300b3..fbf5d6e07 100644 --- a/src/test/ui/generator/drop-tracking-parent-expression.stderr +++ b/src/test/ui/generator/drop-tracking-parent-expression.stderr @@ -1,8 +1,8 @@ error: generator cannot be sent between threads safely - --> $DIR/drop-tracking-parent-expression.rs:24:13 + --> $DIR/drop-tracking-parent-expression.rs:24:25 | LL | assert_send(g); - | ^^^^^^^^^^^ generator is not `Send` + | ^ generator is not `Send` ... LL | / type_combinations!( LL | | // OK @@ -41,10 +41,10 @@ LL | fn assert_send(_thing: T) {} = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) error: generator cannot be sent between threads safely - --> $DIR/drop-tracking-parent-expression.rs:24:13 + --> $DIR/drop-tracking-parent-expression.rs:24:25 | LL | assert_send(g); - | ^^^^^^^^^^^ generator is not `Send` + | ^ generator is not `Send` ... LL | / type_combinations!( LL | | // OK @@ -83,10 +83,10 @@ LL | fn assert_send(_thing: T) {} = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) error: generator cannot be sent between threads safely - --> $DIR/drop-tracking-parent-expression.rs:24:13 + --> $DIR/drop-tracking-parent-expression.rs:24:25 | LL | assert_send(g); - | ^^^^^^^^^^^ generator is not `Send` + | ^ generator is not `Send` ... LL | / type_combinations!( LL | | // OK diff --git a/src/test/ui/generator/drop-yield-twice.stderr b/src/test/ui/generator/drop-yield-twice.stderr index 5bc6ea560..0808a2c85 100644 --- a/src/test/ui/generator/drop-yield-twice.stderr +++ b/src/test/ui/generator/drop-yield-twice.stderr @@ -1,8 +1,14 @@ error: generator cannot be sent between threads safely - --> $DIR/drop-yield-twice.rs:7:5 + --> $DIR/drop-yield-twice.rs:7:17 | -LL | assert_send(|| { - | ^^^^^^^^^^^ generator is not `Send` +LL | assert_send(|| { + | _________________^ +LL | | let guard = Foo(42); +LL | | yield; +LL | | drop(guard); +LL | | yield; +LL | | }) + | |_____^ generator is not `Send` | = help: within `[generator@$DIR/drop-yield-twice.rs:7:17: 7:19]`, the trait `Send` is not implemented for `Foo` note: generator is not `Send` as this value is used across a yield diff --git a/src/test/ui/generator/generator-yielding-or-returning-itself.stderr b/src/test/ui/generator/generator-yielding-or-returning-itself.stderr index 2a39a08ee..8f5d2429a 100644 --- a/src/test/ui/generator/generator-yielding-or-returning-itself.stderr +++ b/src/test/ui/generator/generator-yielding-or-returning-itself.stderr @@ -1,8 +1,15 @@ error[E0271]: type mismatch resolving `<[generator@$DIR/generator-yielding-or-returning-itself.rs:15:34: 15:36] as Generator>::Return == [generator@$DIR/generator-yielding-or-returning-itself.rs:15:34: 15:36]` - --> $DIR/generator-yielding-or-returning-itself.rs:15:5 + --> $DIR/generator-yielding-or-returning-itself.rs:15:34 | -LL | want_cyclic_generator_return(|| { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cyclic type of infinite size +LL | want_cyclic_generator_return(|| { + | _____----------------------------_^ + | | | + | | required by a bound introduced by this call +LL | | +LL | | if false { yield None.unwrap(); } +LL | | None.unwrap() +LL | | }) + | |_____^ cyclic type of infinite size | = note: closures cannot capture themselves or take themselves as argument; this error may be the result of a recent compiler bug-fix, @@ -17,10 +24,17 @@ LL | where T: Generator | ^^^^^^^^^^ required by this bound in `want_cyclic_generator_return` error[E0271]: type mismatch resolving `<[generator@$DIR/generator-yielding-or-returning-itself.rs:28:33: 28:35] as Generator>::Yield == [generator@$DIR/generator-yielding-or-returning-itself.rs:28:33: 28:35]` - --> $DIR/generator-yielding-or-returning-itself.rs:28:5 + --> $DIR/generator-yielding-or-returning-itself.rs:28:33 | -LL | want_cyclic_generator_yield(|| { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cyclic type of infinite size +LL | want_cyclic_generator_yield(|| { + | _____---------------------------_^ + | | | + | | required by a bound introduced by this call +LL | | +LL | | if false { yield None.unwrap(); } +LL | | None.unwrap() +LL | | }) + | |_____^ cyclic type of infinite size | = note: closures cannot capture themselves or take themselves as argument; this error may be the result of a recent compiler bug-fix, diff --git a/src/test/ui/generator/issue-102645.rs b/src/test/ui/generator/issue-102645.rs new file mode 100644 index 000000000..0589c5a00 --- /dev/null +++ b/src/test/ui/generator/issue-102645.rs @@ -0,0 +1,23 @@ +// compile-flags: -Zdrop-tracking + +#![feature(generators, generator_trait)] + +use std::ops::Generator; +use std::pin::Pin; + +fn main() { + let mut a = 5; + let mut b = || { + let d = 6; + yield; + _zzz(); // #break + a = d; + }; + Pin::new(&mut b).resume(); + //~^ ERROR this function takes 1 argument but 0 arguments were supplied + // This type error is required to reproduce the ICE... +} + +fn _zzz() { + () +} diff --git a/src/test/ui/generator/issue-102645.stderr b/src/test/ui/generator/issue-102645.stderr new file mode 100644 index 000000000..7b4d50213 --- /dev/null +++ b/src/test/ui/generator/issue-102645.stderr @@ -0,0 +1,19 @@ +error[E0061]: this function takes 1 argument but 0 arguments were supplied + --> $DIR/issue-102645.rs:16:22 + | +LL | Pin::new(&mut b).resume(); + | ^^^^^^-- an argument of type `()` is missing + | +note: associated function defined here + --> $SRC_DIR/core/src/ops/generator.rs:LL:COL + | +LL | fn resume(self: Pin<&mut Self>, arg: R) -> GeneratorState; + | ^^^^^^ +help: provide the argument + | +LL | Pin::new(&mut b).resume(()); + | ~~~~ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0061`. diff --git a/src/test/ui/generator/issue-52398.stderr b/src/test/ui/generator/issue-52398.stderr index 3f8ebb5a7..30a6732f7 100644 --- a/src/test/ui/generator/issue-52398.stderr +++ b/src/test/ui/generator/issue-52398.stderr @@ -6,8 +6,8 @@ LL | | A.test(yield); LL | | }; | |______^ | - = note: `#[warn(unused_must_use)]` on by default = note: generators are lazy and do nothing unless resumed + = note: `#[warn(unused_must_use)]` on by default warning: unused generator that must be used --> $DIR/issue-52398.rs:24:5 diff --git a/src/test/ui/generator/issue-57084.stderr b/src/test/ui/generator/issue-57084.stderr index 32a04f94d..29aca9440 100644 --- a/src/test/ui/generator/issue-57084.stderr +++ b/src/test/ui/generator/issue-57084.stderr @@ -9,8 +9,8 @@ LL | | } LL | | }; | |______^ | - = note: `#[warn(unused_must_use)]` on by default = note: generators are lazy and do nothing unless resumed + = note: `#[warn(unused_must_use)]` on by default warning: 1 warning emitted diff --git a/src/test/ui/generator/issue-68112.rs b/src/test/ui/generator/issue-68112.rs index 3fcef773b..21026f45c 100644 --- a/src/test/ui/generator/issue-68112.rs +++ b/src/test/ui/generator/issue-68112.rs @@ -63,7 +63,8 @@ fn test2() { require_send(send_gen); //~^ ERROR `RefCell` cannot be shared between threads safely //~| NOTE `RefCell` cannot be shared between threads safely - //~| NOTE requirements on the impl + //~| NOTE required for + //~| NOTE required by a bound introduced by this call //~| NOTE captures the following types } diff --git a/src/test/ui/generator/issue-68112.stderr b/src/test/ui/generator/issue-68112.stderr index 1d5b97e98..eb99d42c9 100644 --- a/src/test/ui/generator/issue-68112.stderr +++ b/src/test/ui/generator/issue-68112.stderr @@ -1,8 +1,8 @@ error: generator cannot be sent between threads safely - --> $DIR/issue-68112.rs:40:5 + --> $DIR/issue-68112.rs:40:18 | LL | require_send(send_gen); - | ^^^^^^^^^^^^ generator is not `Send` + | ^^^^^^^^ generator is not `Send` | = help: the trait `Sync` is not implemented for `RefCell` note: generator is not `Send` as this value is used across a yield @@ -23,13 +23,15 @@ LL | fn require_send(_: impl Send) {} | ^^^^ required by this bound in `require_send` error[E0277]: `RefCell` cannot be shared between threads safely - --> $DIR/issue-68112.rs:63:5 + --> $DIR/issue-68112.rs:63:18 | LL | require_send(send_gen); - | ^^^^^^^^^^^^ `RefCell` cannot be shared between threads safely + | ------------ ^^^^^^^^ `RefCell` cannot be shared between threads safely + | | + | required by a bound introduced by this call | = help: the trait `Sync` is not implemented for `RefCell` - = note: required because of the requirements on the impl of `Send` for `Arc>` + = note: required for `Arc>` to implement `Send` note: required because it's used within this generator --> $DIR/issue-68112.rs:48:5 | diff --git a/src/test/ui/generator/match-bindings.stderr b/src/test/ui/generator/match-bindings.stderr index 4fd1e26f0..b911b6661 100644 --- a/src/test/ui/generator/match-bindings.stderr +++ b/src/test/ui/generator/match-bindings.stderr @@ -10,8 +10,8 @@ LL | | } LL | | }; | |______^ | - = note: `#[warn(unused_must_use)]` on by default = note: generators are lazy and do nothing unless resumed + = note: `#[warn(unused_must_use)]` on by default warning: 1 warning emitted diff --git a/src/test/ui/generator/not-send-sync.stderr b/src/test/ui/generator/not-send-sync.stderr index 0b31bb4fd..a821c57b9 100644 --- a/src/test/ui/generator/not-send-sync.stderr +++ b/src/test/ui/generator/not-send-sync.stderr @@ -1,11 +1,18 @@ error[E0277]: `Cell` cannot be shared between threads safely - --> $DIR/not-send-sync.rs:16:5 + --> $DIR/not-send-sync.rs:16:17 | -LL | assert_send(|| { - | ^^^^^^^^^^^ `Cell` cannot be shared between threads safely +LL | assert_send(|| { + | _____-----------_^ + | | | + | | required by a bound introduced by this call +LL | | +LL | | drop(&a); +LL | | yield; +LL | | }); + | |_____^ `Cell` cannot be shared between threads safely | = help: the trait `Sync` is not implemented for `Cell` - = note: required because of the requirements on the impl of `Send` for `&Cell` + = note: required for `&Cell` to implement `Send` note: required because it's used within this generator --> $DIR/not-send-sync.rs:16:17 | @@ -18,10 +25,15 @@ LL | fn assert_send(_: T) {} | ^^^^ required by this bound in `assert_send` error: generator cannot be shared between threads safely - --> $DIR/not-send-sync.rs:9:5 - | -LL | assert_sync(|| { - | ^^^^^^^^^^^ generator is not `Sync` + --> $DIR/not-send-sync.rs:9:17 + | +LL | assert_sync(|| { + | _________________^ +LL | | +LL | | let a = Cell::new(2); +LL | | yield; +LL | | }); + | |_____^ generator is not `Sync` | = help: within `[generator@$DIR/not-send-sync.rs:9:17: 9:19]`, the trait `Sync` is not implemented for `Cell` note: generator is not `Sync` as this value is used across a yield diff --git a/src/test/ui/generator/panic-drops-resume.rs b/src/test/ui/generator/panic-drops-resume.rs index 8d8eb6a97..4c3caeb14 100644 --- a/src/test/ui/generator/panic-drops-resume.rs +++ b/src/test/ui/generator/panic-drops-resume.rs @@ -2,8 +2,6 @@ // run-pass // needs-unwind -// ignore-wasm no unwind support -// ignore-emscripten no unwind support #![feature(generators, generator_trait)] diff --git a/src/test/ui/generator/panic-drops.rs b/src/test/ui/generator/panic-drops.rs index a9de4e7fc..65001fd87 100644 --- a/src/test/ui/generator/panic-drops.rs +++ b/src/test/ui/generator/panic-drops.rs @@ -1,7 +1,6 @@ // run-pass // needs-unwind -// ignore-wasm32-bare compiled with panic=abort by default #![feature(generators, generator_trait)] diff --git a/src/test/ui/generator/panic-safe.rs b/src/test/ui/generator/panic-safe.rs index 14a0c8dba..3db80bb58 100644 --- a/src/test/ui/generator/panic-safe.rs +++ b/src/test/ui/generator/panic-safe.rs @@ -1,7 +1,6 @@ // run-pass // needs-unwind -// ignore-wasm32-bare compiled with panic=abort by default #![feature(generators, generator_trait)] diff --git a/src/test/ui/generator/partial-drop.stderr b/src/test/ui/generator/partial-drop.stderr index 1004fc64d..9baafe54e 100644 --- a/src/test/ui/generator/partial-drop.stderr +++ b/src/test/ui/generator/partial-drop.stderr @@ -1,8 +1,15 @@ error: generator cannot be sent between threads safely - --> $DIR/partial-drop.rs:14:5 + --> $DIR/partial-drop.rs:14:17 | -LL | assert_send(|| { - | ^^^^^^^^^^^ generator is not `Send` +LL | assert_send(|| { + | _________________^ +LL | | +LL | | // FIXME: it would be nice to make this work. +LL | | let guard = Bar { foo: Foo, x: 42 }; +LL | | drop(guard.foo); +LL | | yield; +LL | | }); + | |_____^ generator is not `Send` | = help: within `[generator@$DIR/partial-drop.rs:14:17: 14:19]`, the trait `Send` is not implemented for `Foo` note: generator is not `Send` as this value is used across a yield @@ -22,10 +29,17 @@ LL | fn assert_send(_: T) {} | ^^^^ required by this bound in `assert_send` error: generator cannot be sent between threads safely - --> $DIR/partial-drop.rs:22:5 + --> $DIR/partial-drop.rs:22:17 | -LL | assert_send(|| { - | ^^^^^^^^^^^ generator is not `Send` +LL | assert_send(|| { + | _________________^ +LL | | +LL | | // FIXME: it would be nice to make this work. +LL | | let guard = Bar { foo: Foo, x: 42 }; +... | +LL | | yield; +LL | | }); + | |_____^ generator is not `Send` | = help: within `[generator@$DIR/partial-drop.rs:22:17: 22:19]`, the trait `Send` is not implemented for `Foo` note: generator is not `Send` as this value is used across a yield @@ -45,10 +59,17 @@ LL | fn assert_send(_: T) {} | ^^^^ required by this bound in `assert_send` error: generator cannot be sent between threads safely - --> $DIR/partial-drop.rs:32:5 + --> $DIR/partial-drop.rs:32:17 | -LL | assert_send(|| { - | ^^^^^^^^^^^ generator is not `Send` +LL | assert_send(|| { + | _________________^ +LL | | +LL | | // FIXME: it would be nice to make this work. +LL | | let guard = Bar { foo: Foo, x: 42 }; +... | +LL | | yield; +LL | | }); + | |_____^ generator is not `Send` | = help: within `[generator@$DIR/partial-drop.rs:32:17: 32:19]`, the trait `Send` is not implemented for `Foo` note: generator is not `Send` as this value is used across a yield diff --git a/src/test/ui/generator/print/generator-print-verbose-1.stderr b/src/test/ui/generator/print/generator-print-verbose-1.stderr index 5b61f1e8f..2e0207804 100644 --- a/src/test/ui/generator/print/generator-print-verbose-1.stderr +++ b/src/test/ui/generator/print/generator-print-verbose-1.stderr @@ -1,15 +1,15 @@ error: generator cannot be sent between threads safely - --> $DIR/generator-print-verbose-1.rs:37:5 + --> $DIR/generator-print-verbose-1.rs:37:18 | LL | require_send(send_gen); - | ^^^^^^^^^^^^ generator is not `Send` + | ^^^^^^^^ generator is not `Send` | = help: the trait `Sync` is not implemented for `RefCell` note: generator is not `Send` as this value is used across a yield --> $DIR/generator-print-verbose-1.rs:35:9 | LL | let _non_send_gen = make_non_send_generator(); - | ------------- has type `Opaque(DefId(0:34 ~ generator_print_verbose_1[749a]::make_non_send_generator::{opaque#0}), [])` which is not `Send` + | ------------- has type `Opaque(DefId(0:44 ~ generator_print_verbose_1[749a]::make_non_send_generator::{opaque#0}), [])` which is not `Send` LL | yield; | ^^^^^ yield occurs here, with `_non_send_gen` maybe used later LL | }; @@ -21,29 +21,31 @@ LL | fn require_send(_: impl Send) {} | ^^^^ required by this bound in `require_send` error[E0277]: `RefCell` cannot be shared between threads safely - --> $DIR/generator-print-verbose-1.rs:56:5 + --> $DIR/generator-print-verbose-1.rs:56:18 | LL | require_send(send_gen); - | ^^^^^^^^^^^^ `RefCell` cannot be shared between threads safely + | ------------ ^^^^^^^^ `RefCell` cannot be shared between threads safely + | | + | required by a bound introduced by this call | = help: the trait `Sync` is not implemented for `RefCell` - = note: required because of the requirements on the impl of `Send` for `Arc>` + = note: required for `Arc>` to implement `Send` note: required because it's used within this generator --> $DIR/generator-print-verbose-1.rs:42:5 | LL | || { | ^^ -note: required because it appears within the type `Opaque(DefId(0:39 ~ generator_print_verbose_1[749a]::make_gen2::{opaque#0}), [std::sync::Arc>])` +note: required because it appears within the type `Opaque(DefId(0:45 ~ generator_print_verbose_1[749a]::make_gen2::{opaque#0}), [std::sync::Arc>])` --> $DIR/generator-print-verbose-1.rs:41:30 | LL | pub fn make_gen2(t: T) -> impl Generator { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: required because it appears within the type `Opaque(DefId(0:42 ~ generator_print_verbose_1[749a]::make_non_send_generator2::{opaque#0}), [])` +note: required because it appears within the type `Opaque(DefId(0:46 ~ generator_print_verbose_1[749a]::make_non_send_generator2::{opaque#0}), [])` --> $DIR/generator-print-verbose-1.rs:47:34 | LL | fn make_non_send_generator2() -> impl Generator>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: required because it captures the following types: `Opaque(DefId(0:42 ~ generator_print_verbose_1[749a]::make_non_send_generator2::{opaque#0}), [])`, `()` + = note: required because it captures the following types: `Opaque(DefId(0:46 ~ generator_print_verbose_1[749a]::make_non_send_generator2::{opaque#0}), [])`, `()` note: required because it's used within this generator --> $DIR/generator-print-verbose-1.rs:52:20 | diff --git a/src/test/ui/generator/print/generator-print-verbose-2.stderr b/src/test/ui/generator/print/generator-print-verbose-2.stderr index eb79d2e6e..909e49c38 100644 --- a/src/test/ui/generator/print/generator-print-verbose-2.stderr +++ b/src/test/ui/generator/print/generator-print-verbose-2.stderr @@ -1,11 +1,18 @@ error[E0277]: `Cell` cannot be shared between threads safely - --> $DIR/generator-print-verbose-2.rs:19:5 + --> $DIR/generator-print-verbose-2.rs:19:17 | -LL | assert_send(|| { - | ^^^^^^^^^^^ `Cell` cannot be shared between threads safely +LL | assert_send(|| { + | _____-----------_^ + | | | + | | required by a bound introduced by this call +LL | | +LL | | drop(&a); +LL | | yield; +LL | | }); + | |_____^ `Cell` cannot be shared between threads safely | = help: the trait `Sync` is not implemented for `Cell` - = note: required because of the requirements on the impl of `Send` for `&'_#4r Cell` + = note: required for `&'_#4r Cell` to implement `Send` note: required because it's used within this generator --> $DIR/generator-print-verbose-2.rs:19:17 | @@ -18,10 +25,15 @@ LL | fn assert_send(_: T) {} | ^^^^ required by this bound in `assert_send` error: generator cannot be shared between threads safely - --> $DIR/generator-print-verbose-2.rs:12:5 - | -LL | assert_sync(|| { - | ^^^^^^^^^^^ generator is not `Sync` + --> $DIR/generator-print-verbose-2.rs:12:17 + | +LL | assert_sync(|| { + | _________________^ +LL | | +LL | | let a = Cell::new(2); +LL | | yield; +LL | | }); + | |_____^ generator is not `Sync` | = help: within `[main::{closure#0} upvar_tys=() {Cell, ()}]`, the trait `Sync` is not implemented for `Cell` note: generator is not `Sync` as this value is used across a yield diff --git a/src/test/ui/generator/reborrow-mut-upvar.stderr b/src/test/ui/generator/reborrow-mut-upvar.stderr index ff511b766..e83dbf833 100644 --- a/src/test/ui/generator/reborrow-mut-upvar.stderr +++ b/src/test/ui/generator/reborrow-mut-upvar.stderr @@ -10,8 +10,8 @@ LL | | *bar = 2; LL | | }; | |______^ | - = note: `#[warn(unused_must_use)]` on by default = note: generators are lazy and do nothing unless resumed + = note: `#[warn(unused_must_use)]` on by default warning: 1 warning emitted diff --git a/src/test/ui/generator/resume-after-return.rs b/src/test/ui/generator/resume-after-return.rs index 538609b98..01a059a16 100644 --- a/src/test/ui/generator/resume-after-return.rs +++ b/src/test/ui/generator/resume-after-return.rs @@ -1,7 +1,6 @@ // run-pass // needs-unwind -// ignore-wasm32-bare compiled with panic=abort by default #![feature(generators, generator_trait)] diff --git a/src/test/ui/generator/size-moved-locals.rs b/src/test/ui/generator/size-moved-locals.rs index 3c756a86f..601a31418 100644 --- a/src/test/ui/generator/size-moved-locals.rs +++ b/src/test/ui/generator/size-moved-locals.rs @@ -12,6 +12,7 @@ // edition:2018 // ignore-wasm32 issue #62807 // ignore-asmjs issue #62807 +// needs-unwind Size of Closures change on panic=abort #![feature(generators, generator_trait)] diff --git a/src/test/ui/generator/too-live-local-in-immovable-gen.stderr b/src/test/ui/generator/too-live-local-in-immovable-gen.stderr index 72a2bd4eb..5cb43067f 100644 --- a/src/test/ui/generator/too-live-local-in-immovable-gen.stderr +++ b/src/test/ui/generator/too-live-local-in-immovable-gen.stderr @@ -10,8 +10,8 @@ LL | | let _ = &a; LL | | }; | |__________^ | - = note: `#[warn(unused_must_use)]` on by default = note: generators are lazy and do nothing unless resumed + = note: `#[warn(unused_must_use)]` on by default warning: 1 warning emitted diff --git a/src/test/ui/generator/type-mismatch-signature-deduction.stderr b/src/test/ui/generator/type-mismatch-signature-deduction.stderr index 7938fc809..b98da1ed8 100644 --- a/src/test/ui/generator/type-mismatch-signature-deduction.stderr +++ b/src/test/ui/generator/type-mismatch-signature-deduction.stderr @@ -11,6 +11,12 @@ note: return type inferred to be `Result<{integer}, _>` here | LL | return Ok(6); | ^^^^^ +help: try wrapping the expression in a variant of `Result` + | +LL | Ok(5) + | +++ + +LL | Err(5) + | ++++ + error[E0271]: type mismatch resolving `<[generator@$DIR/type-mismatch-signature-deduction.rs:7:5: 7:7] as Generator>::Return == i32` --> $DIR/type-mismatch-signature-deduction.rs:5:13 diff --git a/src/test/ui/generator/yield-in-args-rev.stderr b/src/test/ui/generator/yield-in-args-rev.stderr index a575bf886..c9e1ab722 100644 --- a/src/test/ui/generator/yield-in-args-rev.stderr +++ b/src/test/ui/generator/yield-in-args-rev.stderr @@ -7,8 +7,8 @@ LL | | foo(yield, &b); LL | | }; | |______^ | - = note: `#[warn(unused_must_use)]` on by default = note: generators are lazy and do nothing unless resumed + = note: `#[warn(unused_must_use)]` on by default warning: 1 warning emitted diff --git a/src/test/ui/generator/yield-in-box.stderr b/src/test/ui/generator/yield-in-box.stderr index 7602e8039..8587e1dc6 100644 --- a/src/test/ui/generator/yield-in-box.stderr +++ b/src/test/ui/generator/yield-in-box.stderr @@ -10,8 +10,8 @@ LL | | } LL | | }; | |______^ | - = note: `#[warn(unused_must_use)]` on by default = note: generators are lazy and do nothing unless resumed + = note: `#[warn(unused_must_use)]` on by default warning: 1 warning emitted diff --git a/src/test/ui/generator/yield-in-initializer.stderr b/src/test/ui/generator/yield-in-initializer.stderr index e79047ae7..07de24662 100644 --- a/src/test/ui/generator/yield-in-initializer.stderr +++ b/src/test/ui/generator/yield-in-initializer.stderr @@ -10,8 +10,8 @@ LL | | } LL | | }; | |______^ | - = note: `#[warn(unused_must_use)]` on by default = note: generators are lazy and do nothing unless resumed + = note: `#[warn(unused_must_use)]` on by default warning: 1 warning emitted diff --git a/src/test/ui/generator/yield-outside-generator-issue-78653.stderr b/src/test/ui/generator/yield-outside-generator-issue-78653.stderr index ee1afbe5b..dcfb21174 100644 --- a/src/test/ui/generator/yield-outside-generator-issue-78653.stderr +++ b/src/test/ui/generator/yield-outside-generator-issue-78653.stderr @@ -12,7 +12,7 @@ LL | yield || for i in 0 { } | = help: the trait `Iterator` is not implemented for `{integer}` = note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end` - = note: required because of the requirements on the impl of `IntoIterator` for `{integer}` + = note: required for `{integer}` to implement `IntoIterator` error: aborting due to 2 previous errors diff --git a/src/test/ui/generator/yield-subtype.stderr b/src/test/ui/generator/yield-subtype.stderr index bded36a4c..fe10477bf 100644 --- a/src/test/ui/generator/yield-subtype.stderr +++ b/src/test/ui/generator/yield-subtype.stderr @@ -7,8 +7,8 @@ LL | | yield b; LL | | }; | |______^ | - = note: `#[warn(unused_must_use)]` on by default = note: generators are lazy and do nothing unless resumed + = note: `#[warn(unused_must_use)]` on by default warning: 1 warning emitted -- cgit v1.2.3