Skip to content

Commit e0b7d92

Browse files
committed
expr_2021 should be allowed on edition 2021 and later
1 parent 0777912 commit e0b7d92

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_ast/src/token.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ impl NonterminalKind {
907907
},
908908
sym::pat_param => NonterminalKind::PatParam { inferred: false },
909909
sym::expr => NonterminalKind::Expr,
910-
sym::expr_2021 if edition() >= Edition::Edition2024 => NonterminalKind::Expr2021,
910+
sym::expr_2021 if edition() >= Edition::Edition2021 => NonterminalKind::Expr2021,
911911
sym::ty => NonterminalKind::Ty,
912912
sym::ident => NonterminalKind::Ident,
913913
sym::lifetime => NonterminalKind::Lifetime,

tests/ui/macros/expr_2021_old_edition.rs

Lines changed: 1 addition & 1 deletion
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)