about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2022-06-02 20:15:41 +0400
committerMaybe Waffle <waffle.lapkin@gmail.com>2022-07-12 16:25:35 +0400
commit97fcead24219bea0db1d2133ffd347760ec161d8 (patch)
treefc0b2c6a062e23149fc6631d86eca9c9ae6646d7
parent40ae7b5b8e09da657b62bc849b8bcdf99a1cb210 (diff)
downloadrust-97fcead24219bea0db1d2133ffd347760ec161d8.tar.gz
rust-97fcead24219bea0db1d2133ffd347760ec161d8.zip
--bless tests
-rw-r--r--src/test/ui/parser/recover-quantified-closure.rs5
-rw-r--r--src/test/ui/parser/recover-quantified-closure.stderr46
2 files changed, 42 insertions, 9 deletions
diff --git a/src/test/ui/parser/recover-quantified-closure.rs b/src/test/ui/parser/recover-quantified-closure.rs
index 381324738f6..a2bb7fde8ff 100644
--- a/src/test/ui/parser/recover-quantified-closure.rs
+++ b/src/test/ui/parser/recover-quantified-closure.rs
@@ -1,10 +1,13 @@
 fn main() {
     for<'a> |x: &'a u8| *x + 1;
-    //~^ ERROR cannot introduce explicit parameters for a closure
+    //~^ ERROR use of undeclared lifetime name `'a`
+    //~^^ ERROR `for<...>` binders for closures are experimental
+    //~^^^ ERROR `for<...>` binders for closures are not yet supported
 }
 
 enum Foo { Bar }
 fn foo(x: impl Iterator<Item = Foo>) {
     for <Foo>::Bar in x {}
     //~^ ERROR expected one of `move`, `static`, `|`
+    //~^^ ERROR `for<...>` binders for closures are experimental
 }
diff --git a/src/test/ui/parser/recover-quantified-closure.stderr b/src/test/ui/parser/recover-quantified-closure.stderr
index 0f011326516..168307ea65a 100644
--- a/src/test/ui/parser/recover-quantified-closure.stderr
+++ b/src/test/ui/parser/recover-quantified-closure.stderr
@@ -1,16 +1,46 @@
-error: cannot introduce explicit parameters for a closure
+error: expected one of `move`, `static`, `|`, or `||`, found `::`
+  --> $DIR/recover-quantified-closure.rs:10:14
+   |
+LL |     for <Foo>::Bar in x {}
+   |              ^^ expected one of `move`, `static`, `|`, or `||`
+
+error[E0261]: use of undeclared lifetime name `'a`
+  --> $DIR/recover-quantified-closure.rs:2:18
+   |
+LL | fn main() {
+   |        - help: consider introducing lifetime `'a` here: `<'a>`
+LL |     for<'a> |x: &'a u8| *x + 1;
+   |                  ^^ undeclared lifetime
+
+error[E0658]: `for<...>` binders for closures are experimental
   --> $DIR/recover-quantified-closure.rs:2:5
    |
 LL |     for<'a> |x: &'a u8| *x + 1;
-   |     ^^^^^^^ ------------------ the parameters are attached to this closure
-   |     |
-   |     help: remove the parameters
+   |     ^^^^^^^
+   |
+   = note: see issue #97362 <https://github.com/rust-lang/rust/issues/97362> for more information
+   = help: add `#![feature(closure_lifetime_binder)]` to the crate attributes to enable
+   = help: consider removing `for<...>`
 
-error: expected one of `move`, `static`, `|`, or `||`, found `::`
-  --> $DIR/recover-quantified-closure.rs:8:14
+error[E0658]: `for<...>` binders for closures are experimental
+  --> $DIR/recover-quantified-closure.rs:10:5
    |
 LL |     for <Foo>::Bar in x {}
-   |              ^^ expected one of `move`, `static`, `|`, or `||`
+   |     ^^^^^^^^^
+   |
+   = note: see issue #97362 <https://github.com/rust-lang/rust/issues/97362> for more information
+   = help: add `#![feature(closure_lifetime_binder)]` to the crate attributes to enable
+   = help: consider removing `for<...>`
+
+error: `for<...>` binders for closures are not yet supported
+  --> $DIR/recover-quantified-closure.rs:2:5
+   |
+LL |     for<'a> |x: &'a u8| *x + 1;
+   |     ^^^^^^^
+   |
+   = help: consider removing `for<...>`
 
-error: aborting due to 2 previous errors
+error: aborting due to 5 previous errors
 
+Some errors have detailed explanations: E0261, E0658.
+For more information about an error, try `rustc --explain E0261`.