Update compiler/rustc_parse/src/parser/nonterminal.rs
Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
This commit is contained in:
parent
f364011955
commit
3986ea0ea5
@ -3,7 +3,6 @@
|
||||
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;
|
||||
@ -49,7 +48,7 @@ fn may_be_ident(nt: &token::Nonterminal) -> bool {
|
||||
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(),
|
||||
|
Loading…
Reference in New Issue
Block a user