Skip to content

Commit

Permalink
Auto merge of rust-lang#125828 - vincenzopalazzo:macros/performance-r…
Browse files Browse the repository at this point in the history
…egression, r=<try>

[perf-only] rustc_parser: avoid checking the edition as much as possible

CC rust-lang#123865
r? ghost
  • Loading branch information
bors committed May 31, 2024
2 parents ada5e2c + 252f83a commit d693eba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_parse/src/parser/nonterminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl<'a> Parser<'a> {
token.can_begin_expr()
// This exception is here for backwards compatibility.
&& !token.is_keyword(kw::Let)
&& (token.span.edition().at_least_rust_2024() || !token.is_keyword(kw::Const))
&& (!token.is_keyword(kw::Const) || token.span.edition().at_least_rust_2024())
}
NonterminalKind::Ty => token.can_begin_type(),
NonterminalKind::Ident => get_macro_ident(token).is_some(),
Expand Down

0 comments on commit d693eba

Please sign in to comment.