We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
can_begin_expr
1 parent 5013b61 commit 1036fa7Copy full SHA for 1036fa7
compiler/rustc_ast/src/token.rs
@@ -421,10 +421,11 @@ impl Token {
421
422
/// Returns `true` if the token can appear at the start of an expression.
423
pub fn can_begin_expr(&self) -> bool {
424
+ use Delimiter::*;
425
match self.uninterpolate().kind {
426
Ident(name, is_raw) =>
427
ident_can_begin_expr(name, self.span, is_raw), // value name or keyword
- OpenDelim(..) | // tuple, array or block
428
+ OpenDelim(Parenthesis | Brace | Bracket) | // tuple, array or block
429
Literal(..) | // literal
430
Not | // operator not
431
BinOp(Minus) | // unary minus
0 commit comments