Skip to content

Commit 73303c3

Browse files
committed
expr_2021 should be allowed on edition 2021 and later
1 parent 65da4ad commit 73303c3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_ast/src/token.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ impl NonterminalKind {
909909
},
910910
sym::pat_param => NonterminalKind::PatParam { inferred: false },
911911
sym::expr => NonterminalKind::Expr,
912-
sym::expr_2021 if edition() >= Edition::Edition2024 => NonterminalKind::Expr2021,
912+
sym::expr_2021 if edition() >= Edition::Edition2021 => NonterminalKind::Expr2021,
913913
sym::ty => NonterminalKind::Ty,
914914
sym::ident => NonterminalKind::Ident,
915915
sym::lifetime => NonterminalKind::Lifetime,

tests/ui/macros/expr_2021_old_edition.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags: --edition=2021
1+
//@ compile-flags: --edition=2018
22

33
// This test ensures that expr_2021 is not allowed on pre-2024 editions
44

0 commit comments

Comments
 (0)