Closed
Description
#![feature(let_else)]
#[derive(Debug)]
enum Foo {
Done,
Nested(Option<&'static Foo>),
}
fn walk(mut value: &Foo) {
loop {
println!("{:?}", value);
&Foo::Nested(Some(value)) = value else { break };
}
}
results in
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found keyword `else`
--> src/lib.rs:11:36
|
11 | Foo::Nested(value) = value else { break };
| ^^^^ expected one of 8 possible tokens
i.e. a general parser error. This should either be supported and compile, or get a better error.