summaryrefslogtreecommitdiffstats
path: root/src/test/ui/generator
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:11:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:12:43 +0000
commitcf94bdc0742c13e2a0cac864c478b8626b266e1b (patch)
tree044670aa50cc5e2b4229aa0b6b3df6676730c0a6 /src/test/ui/generator
parentAdding debian version 1.65.0+dfsg1-2. (diff)
downloadrustc-cf94bdc0742c13e2a0cac864c478b8626b266e1b.tar.xz
rustc-cf94bdc0742c13e2a0cac864c478b8626b266e1b.zip
Merging upstream version 1.66.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/generator')
-rw-r--r--src/test/ui/generator/issue-102645.rs23
-rw-r--r--src/test/ui/generator/issue-102645.stderr19
-rw-r--r--src/test/ui/generator/issue-52398.stderr2
-rw-r--r--src/test/ui/generator/issue-57084.stderr2
-rw-r--r--src/test/ui/generator/match-bindings.stderr2
-rw-r--r--src/test/ui/generator/panic-drops-resume.rs2
-rw-r--r--src/test/ui/generator/panic-drops.rs1
-rw-r--r--src/test/ui/generator/panic-safe.rs1
-rw-r--r--src/test/ui/generator/print/generator-print-verbose-1.stderr8
-rw-r--r--src/test/ui/generator/reborrow-mut-upvar.stderr2
-rw-r--r--src/test/ui/generator/resume-after-return.rs1
-rw-r--r--src/test/ui/generator/size-moved-locals.rs1
-rw-r--r--src/test/ui/generator/too-live-local-in-immovable-gen.stderr2
-rw-r--r--src/test/ui/generator/yield-in-args-rev.stderr2
-rw-r--r--src/test/ui/generator/yield-in-box.stderr2
-rw-r--r--src/test/ui/generator/yield-in-initializer.stderr2
-rw-r--r--src/test/ui/generator/yield-subtype.stderr2
17 files changed, 56 insertions, 18 deletions
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<Self::Yield, Self::Return>;
+ | ^^^^^^
+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/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/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/print/generator-print-verbose-1.stderr b/src/test/ui/generator/print/generator-print-verbose-1.stderr
index 3a83021dd..2e0207804 100644
--- a/src/test/ui/generator/print/generator-print-verbose-1.stderr
+++ b/src/test/ui/generator/print/generator-print-verbose-1.stderr
@@ -9,7 +9,7 @@ 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 | };
@@ -35,17 +35,17 @@ note: required because it's used within this generator
|
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<std::cell::RefCell<i32>>])`
+note: required because it appears within the type `Opaque(DefId(0:45 ~ generator_print_verbose_1[749a]::make_gen2::{opaque#0}), [std::sync::Arc<std::cell::RefCell<i32>>])`
--> $DIR/generator-print-verbose-1.rs:41:30
|
LL | pub fn make_gen2<T>(t: T) -> impl Generator<Return = T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
-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<Return = Arc<RefCell<i32>>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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/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/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-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