Parse attr in rhs of let stmts

This commit is contained in:
Edwin Cheng 2020-02-28 13:08:47 +08:00
parent e0c6e106d9
commit f4e48ad3e4
3 changed files with 37 additions and 8 deletions

View file

@ -169,6 +169,7 @@ pub(super) fn stmt(p: &mut Parser, with_semi: StmtWithSemi) {
// let d: i32 = 92;
// let e: !;
// let _: ! = {};
// let f = #[attr]||{};
// }
fn let_stmt(p: &mut Parser, m: Marker, with_semi: StmtWithSemi) {
assert!(p.at(T![let]));
@ -178,7 +179,7 @@ pub(super) fn stmt(p: &mut Parser, with_semi: StmtWithSemi) {
types::ascription(p);
}
if p.eat(T![=]) {
expressions::expr(p);
expressions::expr_with_attrs(p);
}
match with_semi {