Skip to content

Commit a542e48

Browse files
committed
remove feature gate
1 parent c75ed34 commit a542e48

File tree

2 files changed

+7
-42
lines changed

2 files changed

+7
-42
lines changed

src/libsyntax/ext/tt/quoted.rs

Lines changed: 7 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -576,22 +576,7 @@ where
576576
let span = match parse_kleene_op(input, span) {
577577
// #1 is a `?` (needs feature gate)
578578
Ok(Ok((op, op1_span))) if op == KleeneOp::ZeroOrOne => {
579-
if !features.macro_at_most_once_rep
580-
&& !attr::contains_name(attrs, "allow_internal_unstable")
581-
{
582-
let explain = feature_gate::EXPLAIN_MACRO_AT_MOST_ONCE_REP;
583-
emit_feature_err(
584-
sess,
585-
"macro_at_most_once_rep",
586-
op1_span,
587-
GateIssue::Language,
588-
explain,
589-
);
590-
591-
op1_span
592-
} else {
593-
return (None, op);
594-
}
579+
return (None, op);
595580
}
596581

597582
// #1 is a `+` or `*` KleeneOp
@@ -602,22 +587,10 @@ where
602587
// #2 is the `?` Kleene op, which does not take a separator (error)
603588
Ok(Ok((op, op2_span))) if op == KleeneOp::ZeroOrOne => {
604589
// Error!
605-
606-
if !features.macro_at_most_once_rep
607-
&& !attr::contains_name(attrs, "allow_internal_unstable")
608-
{
609-
// FIXME: when `?` as a Kleene op is stabilized, we only need the "does not
610-
// take a macro separator" error (i.e. the `else` case).
611-
sess.span_diagnostic
612-
.struct_span_err(op2_span, "expected `*` or `+`")
613-
.note("`?` is not a macro repetition operator")
614-
.emit();
615-
} else {
616-
sess.span_diagnostic.span_err(
617-
span,
618-
"the `?` macro repetition operator does not take a separator",
619-
);
620-
}
590+
sess.span_diagnostic.span_err(
591+
span,
592+
"the `?` macro repetition operator does not take a separator",
593+
);
621594

622595
// Return a dummy
623596
return (None, KleeneOp::ZeroOrMore);
@@ -638,13 +611,8 @@ where
638611
};
639612

640613
// If we ever get to this point, we have experienced an "unexpected token" error
641-
642-
if !features.macro_at_most_once_rep && !attr::contains_name(attrs, "allow_internal_unstable") {
643-
sess.span_diagnostic.span_err(span, "expected `*` or `+`");
644-
} else {
645-
sess.span_diagnostic
646-
.span_err(span, "expected one of: `*`, `+`, or `?`");
647-
}
614+
sess.span_diagnostic
615+
.span_err(span, "expected one of: `*`, `+`, or `?`");
648616

649617
// Return a dummy
650618
(None, KleeneOp::ZeroOrMore)

src/libsyntax/feature_gate.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,9 +1426,6 @@ pub const EXPLAIN_DERIVE_UNDERSCORE: &'static str =
14261426
pub const EXPLAIN_UNSIZED_TUPLE_COERCION: &'static str =
14271427
"unsized tuple coercion is not stable enough for use and is subject to change";
14281428

1429-
pub const EXPLAIN_MACRO_AT_MOST_ONCE_REP: &'static str =
1430-
"using the `?` macro Kleene operator for \"at most one\" repetition is unstable";
1431-
14321429
struct PostExpansionVisitor<'a> {
14331430
context: &'a Context<'a>,
14341431
}

0 commit comments

Comments
 (0)