Allow naming expr_2021 in all editions
This commit is contained in:
parent
50d1efa3e2
commit
3e8898a4e1
8 changed files with 23 additions and 59 deletions
|
@ -1292,7 +1292,9 @@ fn is_in_follow(tok: &mbe::TokenTree, kind: NonterminalKind) -> IsInFollow {
|
|||
// maintain
|
||||
IsInFollow::Yes
|
||||
}
|
||||
NonterminalKind::Stmt | NonterminalKind::Expr | NonterminalKind::Expr2021 => {
|
||||
NonterminalKind::Stmt
|
||||
| NonterminalKind::Expr
|
||||
| NonterminalKind::Expr2021 { inferred: _ } => {
|
||||
const TOKENS: &[&str] = &["`=>`", "`,`", "`;`"];
|
||||
match tok {
|
||||
TokenTree::Token(token) => match token.kind {
|
||||
|
|
|
@ -113,7 +113,8 @@ pub(super) fn parse(
|
|||
);
|
||||
token::NonterminalKind::Ident
|
||||
});
|
||||
if kind == token::NonterminalKind::Expr2021
|
||||
if kind
|
||||
== (token::NonterminalKind::Expr2021 { inferred: false })
|
||||
&& !features.expr_fragment_specifier_2024
|
||||
{
|
||||
rustc_session::parse::feature_err(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue