rust/src/test/ui/parser/recover-quantified-closure.rs
2020-03-21 09:54:03 +01:00

11 lines
251 B
Rust

fn main() {
for<'a> |x: &'a u8| *x + 1;
//~^ ERROR cannot introduce explicit parameters for a closure
}
enum Foo { Bar }
fn foo(x: impl Iterator<Item = Foo>) {
for <Foo>::Bar in x {}
//~^ ERROR expected one of `move`, `static`, `|`
}