From 3986ea0ea555ab6de8af46932da94c26aa1c28ee Mon Sep 17 00:00:00 2001 From: Eric Holk Date: Fri, 17 May 2024 11:27:18 -0700 Subject: [PATCH] Update compiler/rustc_parse/src/parser/nonterminal.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: León Orell Valerian Liehr --- compiler/rustc_parse/src/parser/nonterminal.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_parse/src/parser/nonterminal.rs b/compiler/rustc_parse/src/parser/nonterminal.rs index 8c0f295b74bc3..274157dee57bf 100644 --- a/compiler/rustc_parse/src/parser/nonterminal.rs +++ b/compiler/rustc_parse/src/parser/nonterminal.rs @@ -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; @@ -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(),