From 73303c3b454379772053957d88437277a121c173 Mon Sep 17 00:00:00 2001 From: Eric Holk Date: Tue, 16 Apr 2024 10:31:21 -0700 Subject: [PATCH] expr_2021 should be allowed on edition 2021 and later --- compiler/rustc_ast/src/token.rs | 2 +- tests/ui/macros/expr_2021_old_edition.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_ast/src/token.rs b/compiler/rustc_ast/src/token.rs index 0b741c2cc40..bbab13221d3 100644 --- a/compiler/rustc_ast/src/token.rs +++ b/compiler/rustc_ast/src/token.rs @@ -909,7 +909,7 @@ pub fn from_symbol( }, sym::pat_param => NonterminalKind::PatParam { inferred: false }, sym::expr => NonterminalKind::Expr, - sym::expr_2021 if edition() >= Edition::Edition2024 => NonterminalKind::Expr2021, + sym::expr_2021 if edition() >= Edition::Edition2021 => NonterminalKind::Expr2021, sym::ty => NonterminalKind::Ty, sym::ident => NonterminalKind::Ident, sym::lifetime => NonterminalKind::Lifetime, diff --git a/tests/ui/macros/expr_2021_old_edition.rs b/tests/ui/macros/expr_2021_old_edition.rs index 329c5cdca33..ab7999ab373 100644 --- a/tests/ui/macros/expr_2021_old_edition.rs +++ b/tests/ui/macros/expr_2021_old_edition.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition=2021 +//@ compile-flags: --edition=2018 // This test ensures that expr_2021 is not allowed on pre-2024 editions