Skip to content

Commit

Permalink
Fix None-delimited let expression in stmt position
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Dec 11, 2023
1 parent 5325b6d commit 384621a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion src/stmt.rs
Expand Up @@ -200,7 +200,7 @@ pub(crate) mod parsing {
}
}

if input.peek(Token![let]) {
if input.peek(Token![let]) && !input.peek(token::Group) {
stmt_local(input, attrs).map(Stmt::Local)
} else if input.peek(Token![pub])
|| input.peek(Token![crate]) && !input.peek2(Token![::])
Expand Down
1 change: 0 additions & 1 deletion tests/test_stmt.rs
Expand Up @@ -85,7 +85,6 @@ fn test_none_group() {

let tokens = Group::new(Delimiter::None, quote!(let None = None)).to_token_stream();
let stmts = Block::parse_within.parse2(tokens).unwrap();
// FIXME
snapshot!(stmts, @r###"
[
Stmt::Expr(
Expand Down

0 comments on commit 384621a

Please sign in to comment.