From 97fcead24219bea0db1d2133ffd347760ec161d8 Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Thu, 2 Jun 2022 20:15:41 +0400 Subject: [PATCH] --bless tests --- .../ui/parser/recover-quantified-closure.rs | 5 +- .../parser/recover-quantified-closure.stderr | 50 +++++++++++++++---- 2 files changed, 44 insertions(+), 11 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) { for ::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 - --> $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 - error: expected one of `move`, `static`, `|`, or `||`, found `::` - --> $DIR/recover-quantified-closure.rs:8:14 + --> $DIR/recover-quantified-closure.rs:10:14 | LL | for ::Bar in x {} | ^^ expected one of `move`, `static`, `|`, or `||` -error: aborting due to 2 previous errors +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; + | ^^^^^^^ + | + = note: see issue #97362 for more information + = help: add `#![feature(closure_lifetime_binder)]` to the crate attributes to enable + = help: consider removing `for<...>` + +error[E0658]: `for<...>` binders for closures are experimental + --> $DIR/recover-quantified-closure.rs:10:5 + | +LL | for ::Bar in x {} + | ^^^^^^^^^ + | + = note: see issue #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 5 previous errors + +Some errors have detailed explanations: E0261, E0658. +For more information about an error, try `rustc --explain E0261`.