1
Fork 0

remove pat2021

This commit is contained in:
mark 2021-04-27 21:15:59 -05:00
parent 3f7b98ebe0
commit 2a9db919ff
14 changed files with 35 additions and 80 deletions

View file

@ -1116,7 +1116,7 @@ fn is_in_follow(tok: &mbe::TokenTree, kind: NonterminalKind) -> IsInFollow {
_ => IsInFollow::No(TOKENS),
}
}
NonterminalKind::Pat2021 { .. } => {
NonterminalKind::PatWithOr { .. } => {
const TOKENS: &[&str] = &["`=>`", "`,`", "`=`", "`if`", "`in`"];
match tok {
TokenTree::Token(token) => match token.kind {

View file

@ -6,8 +6,8 @@ use rustc_ast::tokenstream;
use rustc_ast::{NodeId, DUMMY_NODE_ID};
use rustc_ast_pretty::pprust;
use rustc_feature::Features;
use rustc_session::parse::{feature_err, ParseSess};
use rustc_span::symbol::{kw, sym, Ident};
use rustc_session::parse::ParseSess;
use rustc_span::symbol::{kw, Ident};
use rustc_span::Span;
@ -62,18 +62,6 @@ pub(super) fn parse(
Some((frag, _)) => {
let span = token.span.with_lo(start_sp.lo());
if matches!(frag.name, sym::pat2021)
&& !features.edition_macro_pats
{
feature_err(
sess,
sym::edition_macro_pats,
frag.span,
"`pat2021` is unstable.",
)
.emit();
}
let kind =
token::NonterminalKind::from_symbol(frag.name, || {
span.edition()