summaryrefslogtreecommitdiffstats
path: root/src/test/ui/closures/binder
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/closures/binder
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/closures/binder')
-rw-r--r--src/test/ui/closures/binder/async-closure-with-binder.rs8
-rw-r--r--src/test/ui/closures/binder/async-closure-with-binder.stderr16
-rw-r--r--src/test/ui/closures/binder/disallow-const.rs6
-rw-r--r--src/test/ui/closures/binder/disallow-const.stderr8
-rw-r--r--src/test/ui/closures/binder/disallow-ty.rs6
-rw-r--r--src/test/ui/closures/binder/disallow-ty.stderr8
-rw-r--r--src/test/ui/closures/binder/implicit-return.rs6
-rw-r--r--src/test/ui/closures/binder/implicit-return.stderr10
-rw-r--r--src/test/ui/closures/binder/implicit-stuff.rs27
-rw-r--r--src/test/ui/closures/binder/implicit-stuff.stderr107
-rw-r--r--src/test/ui/closures/binder/late-bound-in-body.rs9
-rw-r--r--src/test/ui/closures/binder/nested-closures-regions.rs9
-rw-r--r--src/test/ui/closures/binder/nested-closures-regions.stderr38
-rw-r--r--src/test/ui/closures/binder/nested-closures.rs7
-rw-r--r--src/test/ui/closures/binder/suggestion-for-introducing-lifetime-into-binder.rs7
-rw-r--r--src/test/ui/closures/binder/suggestion-for-introducing-lifetime-into-binder.stderr33
16 files changed, 0 insertions, 305 deletions
diff --git a/src/test/ui/closures/binder/async-closure-with-binder.rs b/src/test/ui/closures/binder/async-closure-with-binder.rs
deleted file mode 100644
index 4fa599d37..000000000
--- a/src/test/ui/closures/binder/async-closure-with-binder.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-// edition:2021
-#![feature(closure_lifetime_binder)]
-#![feature(async_closure)]
-fn main() {
- for<'a> async || ();
- //~^ ERROR `for<...>` binders on `async` closures are not currently supported
- //~^^ ERROR implicit types in closure signatures are forbidden when `for<...>` is present
-}
diff --git a/src/test/ui/closures/binder/async-closure-with-binder.stderr b/src/test/ui/closures/binder/async-closure-with-binder.stderr
deleted file mode 100644
index 1d4628b1a..000000000
--- a/src/test/ui/closures/binder/async-closure-with-binder.stderr
+++ /dev/null
@@ -1,16 +0,0 @@
-error: `for<...>` binders on `async` closures are not currently supported
- --> $DIR/async-closure-with-binder.rs:5:5
- |
-LL | for<'a> async || ();
- | ^^^^^^^
-
-error: implicit types in closure signatures are forbidden when `for<...>` is present
- --> $DIR/async-closure-with-binder.rs:5:5
- |
-LL | for<'a> async || ();
- | -------^^^^^^^^^
- | |
- | `for<...>` is here
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/closures/binder/disallow-const.rs b/src/test/ui/closures/binder/disallow-const.rs
deleted file mode 100644
index 72ad6185d..000000000
--- a/src/test/ui/closures/binder/disallow-const.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-#![feature(closure_lifetime_binder)]
-
-fn main() {
- for<const N: i32> || -> () {};
- //~^ ERROR only lifetime parameters can be used in this context
-}
diff --git a/src/test/ui/closures/binder/disallow-const.stderr b/src/test/ui/closures/binder/disallow-const.stderr
deleted file mode 100644
index 3c3b43d8c..000000000
--- a/src/test/ui/closures/binder/disallow-const.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: only lifetime parameters can be used in this context
- --> $DIR/disallow-const.rs:4:15
- |
-LL | for<const N: i32> || -> () {};
- | ^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/closures/binder/disallow-ty.rs b/src/test/ui/closures/binder/disallow-ty.rs
deleted file mode 100644
index bbe3d8488..000000000
--- a/src/test/ui/closures/binder/disallow-ty.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-#![feature(closure_lifetime_binder)]
-
-fn main() {
- for<T> || -> () {};
- //~^ ERROR only lifetime parameters can be used in this context
-}
diff --git a/src/test/ui/closures/binder/disallow-ty.stderr b/src/test/ui/closures/binder/disallow-ty.stderr
deleted file mode 100644
index 51b6773ed..000000000
--- a/src/test/ui/closures/binder/disallow-ty.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: only lifetime parameters can be used in this context
- --> $DIR/disallow-ty.rs:4:9
- |
-LL | for<T> || -> () {};
- | ^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/closures/binder/implicit-return.rs b/src/test/ui/closures/binder/implicit-return.rs
deleted file mode 100644
index d34e5721d..000000000
--- a/src/test/ui/closures/binder/implicit-return.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-#![feature(closure_lifetime_binder)]
-
-fn main() {
- let _f = for<'a> |_: &'a ()| {};
- //~^ implicit types in closure signatures are forbidden when `for<...>` is present
-}
diff --git a/src/test/ui/closures/binder/implicit-return.stderr b/src/test/ui/closures/binder/implicit-return.stderr
deleted file mode 100644
index 5bfb97113..000000000
--- a/src/test/ui/closures/binder/implicit-return.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: implicit types in closure signatures are forbidden when `for<...>` is present
- --> $DIR/implicit-return.rs:4:34
- |
-LL | let _f = for<'a> |_: &'a ()| {};
- | ------- ^
- | |
- | `for<...>` is here
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/closures/binder/implicit-stuff.rs b/src/test/ui/closures/binder/implicit-stuff.rs
deleted file mode 100644
index 09e4c747a..000000000
--- a/src/test/ui/closures/binder/implicit-stuff.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-#![feature(closure_lifetime_binder)]
-
-fn main() {
- // Implicit types
- let _ = for<> || {}; //~ ERROR implicit types in closure signatures are forbidden when `for<...>` is present
- let _ = for<'a> || -> &'a _ { &() }; //~ ERROR implicit types in closure signatures are forbidden when `for<...>` is present
- let _ = for<'a> |x| -> &'a () { x }; //~ ERROR implicit types in closure signatures are forbidden when `for<...>` is present
- let _ = for<'a> |x: &'a _| -> &'a () { x }; //~ ERROR implicit types in closure signatures are forbidden when `for<...>` is present
- let _ = for<'a> |x: &'a Vec::<_>| -> &'a Vec::<()> { x }; //~ ERROR implicit types in closure signatures are forbidden when `for<...>` is present
- let _ = for<'a> |x: &'a Vec<()>| -> &'a Vec<_> { x }; //~ ERROR implicit types in closure signatures are forbidden when `for<...>` is present
- let _ = for<'a> |x: &'a _| -> &'a &'a () { x }; //~ ERROR implicit types in closure signatures are forbidden when `for<...>` is present
- let _ = for<'a> |x: &'a _, y, z: _| -> &'a _ { //~ ERROR implicit types in closure signatures are forbidden when `for<...>` is present
- let _: &u8 = x;
- let _: u32 = y;
- let _: i32 = z;
- x
- };
-
- // Lifetime elision
- let _ = for<> |_: &()| -> () {}; //~ ERROR `&` without an explicit lifetime name cannot be used here
- let _ = for<> |x: &()| -> &() { x }; //~ ERROR `&` without an explicit lifetime name cannot be used here
- //~| ERROR `&` without an explicit lifetime name cannot be used here
- let _ = for<> |x: &'_ ()| -> &'_ () { x }; //~ ERROR `'_` cannot be used here
- //~| ERROR `'_` cannot be used here
- let _ = for<'a> |x: &()| -> &'a () { x }; //~ ERROR `&` without an explicit lifetime name cannot be used here
- let _ = for<'a> |x: &'a ()| -> &() { x }; //~ ERROR `&` without an explicit lifetime name cannot be used here
-}
diff --git a/src/test/ui/closures/binder/implicit-stuff.stderr b/src/test/ui/closures/binder/implicit-stuff.stderr
deleted file mode 100644
index 779a08a44..000000000
--- a/src/test/ui/closures/binder/implicit-stuff.stderr
+++ /dev/null
@@ -1,107 +0,0 @@
-error[E0637]: `&` without an explicit lifetime name cannot be used here
- --> $DIR/implicit-stuff.rs:20:23
- |
-LL | let _ = for<> |_: &()| -> () {};
- | ^ explicit lifetime name needed here
-
-error[E0637]: `&` without an explicit lifetime name cannot be used here
- --> $DIR/implicit-stuff.rs:21:23
- |
-LL | let _ = for<> |x: &()| -> &() { x };
- | ^ explicit lifetime name needed here
-
-error[E0637]: `&` without an explicit lifetime name cannot be used here
- --> $DIR/implicit-stuff.rs:21:31
- |
-LL | let _ = for<> |x: &()| -> &() { x };
- | ^ explicit lifetime name needed here
-
-error[E0637]: `'_` cannot be used here
- --> $DIR/implicit-stuff.rs:23:24
- |
-LL | let _ = for<> |x: &'_ ()| -> &'_ () { x };
- | ^^ `'_` is a reserved lifetime name
-
-error[E0637]: `'_` cannot be used here
- --> $DIR/implicit-stuff.rs:23:35
- |
-LL | let _ = for<> |x: &'_ ()| -> &'_ () { x };
- | ^^ `'_` is a reserved lifetime name
-
-error[E0637]: `&` without an explicit lifetime name cannot be used here
- --> $DIR/implicit-stuff.rs:25:25
- |
-LL | let _ = for<'a> |x: &()| -> &'a () { x };
- | ^ explicit lifetime name needed here
-
-error[E0637]: `&` without an explicit lifetime name cannot be used here
- --> $DIR/implicit-stuff.rs:26:36
- |
-LL | let _ = for<'a> |x: &'a ()| -> &() { x };
- | ^ explicit lifetime name needed here
-
-error: implicit types in closure signatures are forbidden when `for<...>` is present
- --> $DIR/implicit-stuff.rs:5:22
- |
-LL | let _ = for<> || {};
- | ----- ^
- | |
- | `for<...>` is here
-
-error: implicit types in closure signatures are forbidden when `for<...>` is present
- --> $DIR/implicit-stuff.rs:6:31
- |
-LL | let _ = for<'a> || -> &'a _ { &() };
- | ------- ^
- | |
- | `for<...>` is here
-
-error: implicit types in closure signatures are forbidden when `for<...>` is present
- --> $DIR/implicit-stuff.rs:7:22
- |
-LL | let _ = for<'a> |x| -> &'a () { x };
- | ------- ^
- | |
- | `for<...>` is here
-
-error: implicit types in closure signatures are forbidden when `for<...>` is present
- --> $DIR/implicit-stuff.rs:8:29
- |
-LL | let _ = for<'a> |x: &'a _| -> &'a () { x };
- | ------- ^
- | |
- | `for<...>` is here
-
-error: implicit types in closure signatures are forbidden when `for<...>` is present
- --> $DIR/implicit-stuff.rs:9:35
- |
-LL | let _ = for<'a> |x: &'a Vec::<_>| -> &'a Vec::<()> { x };
- | ------- ^
- | |
- | `for<...>` is here
-
-error: implicit types in closure signatures are forbidden when `for<...>` is present
- --> $DIR/implicit-stuff.rs:10:49
- |
-LL | let _ = for<'a> |x: &'a Vec<()>| -> &'a Vec<_> { x };
- | ------- `for<...>` is here ^
-
-error: implicit types in closure signatures are forbidden when `for<...>` is present
- --> $DIR/implicit-stuff.rs:11:29
- |
-LL | let _ = for<'a> |x: &'a _| -> &'a &'a () { x };
- | ------- ^
- | |
- | `for<...>` is here
-
-error: implicit types in closure signatures are forbidden when `for<...>` is present
- --> $DIR/implicit-stuff.rs:12:29
- |
-LL | let _ = for<'a> |x: &'a _, y, z: _| -> &'a _ {
- | ------- ^ ^ ^ ^
- | |
- | `for<...>` is here
-
-error: aborting due to 15 previous errors
-
-For more information about this error, try `rustc --explain E0637`.
diff --git a/src/test/ui/closures/binder/late-bound-in-body.rs b/src/test/ui/closures/binder/late-bound-in-body.rs
deleted file mode 100644
index bb5c7552f..000000000
--- a/src/test/ui/closures/binder/late-bound-in-body.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-// check-pass
-
-#![feature(closure_lifetime_binder)]
-
-fn main() {
- let _ = for<'a> || -> () {
- let _: &'a bool = &true;
- };
-}
diff --git a/src/test/ui/closures/binder/nested-closures-regions.rs b/src/test/ui/closures/binder/nested-closures-regions.rs
deleted file mode 100644
index 6bfc6c80b..000000000
--- a/src/test/ui/closures/binder/nested-closures-regions.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-// check-pass
-
-#![feature(closure_lifetime_binder)]
-#![feature(rustc_attrs)]
-
-#[rustc_regions]
-fn main() {
- for<'a> || -> () { for<'c> |_: &'a ()| -> () {}; };
-}
diff --git a/src/test/ui/closures/binder/nested-closures-regions.stderr b/src/test/ui/closures/binder/nested-closures-regions.stderr
deleted file mode 100644
index b385e0ed6..000000000
--- a/src/test/ui/closures/binder/nested-closures-regions.stderr
+++ /dev/null
@@ -1,38 +0,0 @@
-note: external requirements
- --> $DIR/nested-closures-regions.rs:8:24
- |
-LL | for<'a> || -> () { for<'c> |_: &'a ()| -> () {}; };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: defining type: main::{closure#0}::{closure#0} with closure substs [
- i8,
- extern "rust-call" fn((&(),)),
- (),
- ]
- = note: late-bound region is '_#4r
- = note: late-bound region is '_#2r
- = note: number of external vids: 3
- = note: where '_#1r: '_#2r
- = note: where '_#2r: '_#1r
-
-note: no external requirements
- --> $DIR/nested-closures-regions.rs:8:5
- |
-LL | for<'a> || -> () { for<'c> |_: &'a ()| -> () {}; };
- | ^^^^^^^^^^^^^^^^
- |
- = note: defining type: main::{closure#0} with closure substs [
- i8,
- extern "rust-call" fn(()),
- (),
- ]
- = note: late-bound region is '_#2r
-
-note: no external requirements
- --> $DIR/nested-closures-regions.rs:7:1
- |
-LL | fn main() {
- | ^^^^^^^^^
- |
- = note: defining type: main
-
diff --git a/src/test/ui/closures/binder/nested-closures.rs b/src/test/ui/closures/binder/nested-closures.rs
deleted file mode 100644
index b3c36e7ee..000000000
--- a/src/test/ui/closures/binder/nested-closures.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-// check-pass
-
-#![feature(closure_lifetime_binder)]
-
-fn main() {
- for<'a> || -> () { for<'c> |_: &'a ()| -> () {}; };
-}
diff --git a/src/test/ui/closures/binder/suggestion-for-introducing-lifetime-into-binder.rs b/src/test/ui/closures/binder/suggestion-for-introducing-lifetime-into-binder.rs
deleted file mode 100644
index b476dd50c..000000000
--- a/src/test/ui/closures/binder/suggestion-for-introducing-lifetime-into-binder.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-#![feature(closure_lifetime_binder)]
-fn main() {
- for<> |_: &'a ()| -> () {};
- //~^ ERROR use of undeclared lifetime name `'a`
- for<'a> |_: &'b ()| -> () {};
- //~^ ERROR use of undeclared lifetime name `'b`
-}
diff --git a/src/test/ui/closures/binder/suggestion-for-introducing-lifetime-into-binder.stderr b/src/test/ui/closures/binder/suggestion-for-introducing-lifetime-into-binder.stderr
deleted file mode 100644
index 1381acc15..000000000
--- a/src/test/ui/closures/binder/suggestion-for-introducing-lifetime-into-binder.stderr
+++ /dev/null
@@ -1,33 +0,0 @@
-error[E0261]: use of undeclared lifetime name `'a`
- --> $DIR/suggestion-for-introducing-lifetime-into-binder.rs:3:16
- |
-LL | for<> |_: &'a ()| -> () {};
- | ^^ undeclared lifetime
- |
-help: consider introducing lifetime `'a` here
- |
-LL | for<'a, > |_: &'a ()| -> () {};
- | +++
-help: consider introducing lifetime `'a` here
- |
-LL | fn main<'a>() {
- | ++++
-
-error[E0261]: use of undeclared lifetime name `'b`
- --> $DIR/suggestion-for-introducing-lifetime-into-binder.rs:5:18
- |
-LL | for<'a> |_: &'b ()| -> () {};
- | ^^ undeclared lifetime
- |
-help: consider introducing lifetime `'b` here
- |
-LL | for<'b, 'a> |_: &'b ()| -> () {};
- | +++
-help: consider introducing lifetime `'b` here
- |
-LL | fn main<'b>() {
- | ++++
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0261`.