Closed
Description
Bug Report
🕗 Version & Regression Information
nightly
🧪 Features
if_let_guard
💻 Code
#![feature(if_let_guard)]
struct Bar {}
struct Foo { a: u32 }
fn main() {
match 0 {
_ if let _ = Bar {} => {}
_ if let _ = Foo { a: 0 } => {}
_ => {}
}
}
🙁 Actual behavior
_ if let _ = Bar {} => {}
// ^ error: expected one of `!`, `.`, `::`, `=>`, `?`, or an operator
_ if let _ = Foo { a: 0 } => {}
// ^^^^^^^^^^^^ error: struct literals are not allowed here
// help: surround the struct literal with parentheses
🙂 Expected behavior
No error