about summary refs log tree commit diff
path: root/src/test/ui/parser
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2022-07-12 13:34:24 +0400
committerMaybe Waffle <waffle.lapkin@gmail.com>2022-07-12 21:00:03 +0400
commitc2dbd62c7c60cd4017c9d499101e40c129e4bc61 (patch)
tree2b995dbbc34a3a74ea4ff4b8a6dcbd3b66198afa /src/test/ui/parser
parentf89ef3cf66206b7c0ba0ca134de40b567c7bda83 (diff)
downloadrust-c2dbd62c7c60cd4017c9d499101e40c129e4bc61.tar.gz
rust-c2dbd62c7c60cd4017c9d499101e40c129e4bc61.zip
Lower closure binders to hir & properly check them
Diffstat (limited to 'src/test/ui/parser')
-rw-r--r--src/test/ui/parser/recover-quantified-closure.rs5
-rw-r--r--src/test/ui/parser/recover-quantified-closure.stderr27
2 files changed, 11 insertions, 21 deletions
diff --git a/src/test/ui/parser/recover-quantified-closure.rs b/src/test/ui/parser/recover-quantified-closure.rs
index a2bb7fde8ff..10af39b7007 100644
--- a/src/test/ui/parser/recover-quantified-closure.rs
+++ b/src/test/ui/parser/recover-quantified-closure.rs
@@ -1,8 +1,7 @@
 fn main() {
     for<'a> |x: &'a u8| *x + 1;
-    //~^ ERROR use of undeclared lifetime name `'a`
-    //~^^ ERROR `for<...>` binders for closures are experimental
-    //~^^^ ERROR `for<...>` binders for closures are not yet supported
+    //~^ ERROR `for<...>` binders for closures are experimental
+    //~^^ ERROR implicit types in closure signatures are forbidden when `for<...>` is present
 }
 
 enum Foo { Bar }
diff --git a/src/test/ui/parser/recover-quantified-closure.stderr b/src/test/ui/parser/recover-quantified-closure.stderr
index 168307ea65a..39eec80f658 100644
--- a/src/test/ui/parser/recover-quantified-closure.stderr
+++ b/src/test/ui/parser/recover-quantified-closure.stderr
@@ -1,17 +1,9 @@
 error: expected one of `move`, `static`, `|`, or `||`, found `::`
-  --> $DIR/recover-quantified-closure.rs:10:14
+  --> $DIR/recover-quantified-closure.rs:9: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
    |
@@ -23,7 +15,7 @@ LL |     for<'a> |x: &'a u8| *x + 1;
    = help: consider removing `for<...>`
 
 error[E0658]: `for<...>` binders for closures are experimental
-  --> $DIR/recover-quantified-closure.rs:10:5
+  --> $DIR/recover-quantified-closure.rs:9:5
    |
 LL |     for <Foo>::Bar in x {}
    |     ^^^^^^^^^
@@ -32,15 +24,14 @@ LL |     for <Foo>::Bar in x {}
    = 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
+error: implicit types in closure signatures are forbidden when `for<...>` is present
+  --> $DIR/recover-quantified-closure.rs:2:25
    |
 LL |     for<'a> |x: &'a u8| *x + 1;
-   |     ^^^^^^^
-   |
-   = help: consider removing `for<...>`
+   |     -------             ^
+   |     |
+   |     `for<...>` is here
 
-error: aborting due to 5 previous errors
+error: aborting due to 4 previous errors
 
-Some errors have detailed explanations: E0261, E0658.
-For more information about an error, try `rustc --explain E0261`.
+For more information about this error, try `rustc --explain E0658`.