Skip to content

Commit

Permalink
expr_2021 should be allowed on edition 2021 and later
Browse files Browse the repository at this point in the history
  • Loading branch information
eholk committed May 13, 2024
1 parent 65da4ad commit 73303c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_ast/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ impl NonterminalKind {
},
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,
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/macros/expr_2021_old_edition.rs
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 73303c3

Please sign in to comment.