Skip to content

Commit

Permalink
Update compiler/rustc_parse/src/parser/nonterminal.rs
Browse files Browse the repository at this point in the history
Co-authored-by: León Orell Valerian Liehr <[email protected]>
  • Loading branch information
eholk and fmease committed May 17, 2024
1 parent f364011 commit 3986ea0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions compiler/rustc_parse/src/parser/nonterminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use rustc_ast::token::{self, Delimiter, Nonterminal, Nonterminal::*, Nonterminal
use rustc_ast::HasTokens;
use rustc_ast_pretty::pprust;
use rustc_errors::PResult;
use rustc_span::edition::Edition;
use rustc_span::symbol::{kw, Ident};

use crate::errors::UnexpectedNonterminal;
Expand Down Expand Up @@ -49,7 +48,7 @@ impl<'a> Parser<'a> {
token.can_begin_expr()
// This exception is here for backwards compatibility.
&& !token.is_keyword(kw::Let)
&& (token.span.edition() >= Edition::Edition2024 || !token.is_keyword(kw::Const))
&& (token.span.edition().at_least_rust_2024() || !token.is_keyword(kw::Const))
}
NonterminalKind::Ty => token.can_begin_type(),
NonterminalKind::Ident => get_macro_ident(token).is_some(),
Expand Down

0 comments on commit 3986ea0

Please sign in to comment.