summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/recover-quantified-closure.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/parser/recover-quantified-closure.rs')
-rw-r--r--tests/ui/parser/recover-quantified-closure.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/parser/recover-quantified-closure.rs b/tests/ui/parser/recover-quantified-closure.rs
new file mode 100644
index 000000000..df22f5e06
--- /dev/null
+++ b/tests/ui/parser/recover-quantified-closure.rs
@@ -0,0 +1,12 @@
+fn main() {
+ for<'a> |x: &'a u8| *x + 1;
+ //~^ ERROR `for<...>` binders for closures are experimental
+ //~^^ ERROR implicit types in closure signatures are forbidden when `for<...>` is present
+}
+
+enum Foo { Bar }
+fn foo(x: impl Iterator<Item = Foo>) {
+ for <Foo>::Bar in x {}
+ //~^ ERROR expected one of `const`, `move`, `static`, `|`
+ //~^^ ERROR `for<...>` binders for closures are experimental
+}