diff options
| author | Mark Mansi <markm@cs.wisc.edu> | 2018-11-24 16:12:16 -0600 |
|---|---|---|
| committer | Mark Mansi <markm@cs.wisc.edu> | 2018-11-27 13:08:41 -0600 |
| commit | a542e48871e040ea2db3b4fad5d88a83b6200855 (patch) | |
| tree | b5499ba9604d940477ba8f2b3559bea993cb3196 /src/libsyntax | |
| parent | c75ed34732f67ce41faf84e22e4896cabab14a40 (diff) | |
| download | rust-a542e48871e040ea2db3b4fad5d88a83b6200855.tar.gz rust-a542e48871e040ea2db3b4fad5d88a83b6200855.zip | |
remove feature gate
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/tt/quoted.rs | 46 | ||||
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 3 |
2 files changed, 7 insertions, 42 deletions
diff --git a/src/libsyntax/ext/tt/quoted.rs b/src/libsyntax/ext/tt/quoted.rs index 21848674831..c8ece7b3a88 100644 --- a/src/libsyntax/ext/tt/quoted.rs +++ b/src/libsyntax/ext/tt/quoted.rs @@ -576,22 +576,7 @@ where let span = match parse_kleene_op(input, span) { // #1 is a `?` (needs feature gate) Ok(Ok((op, op1_span))) if op == KleeneOp::ZeroOrOne => { - if !features.macro_at_most_once_rep - && !attr::contains_name(attrs, "allow_internal_unstable") - { - let explain = feature_gate::EXPLAIN_MACRO_AT_MOST_ONCE_REP; - emit_feature_err( - sess, - "macro_at_most_once_rep", - op1_span, - GateIssue::Language, - explain, - ); - - op1_span - } else { - return (None, op); - } + return (None, op); } // #1 is a `+` or `*` KleeneOp @@ -602,22 +587,10 @@ where // #2 is the `?` Kleene op, which does not take a separator (error) Ok(Ok((op, op2_span))) if op == KleeneOp::ZeroOrOne => { // Error! - - if !features.macro_at_most_once_rep - && !attr::contains_name(attrs, "allow_internal_unstable") - { - // FIXME: when `?` as a Kleene op is stabilized, we only need the "does not - // take a macro separator" error (i.e. the `else` case). - sess.span_diagnostic - .struct_span_err(op2_span, "expected `*` or `+`") - .note("`?` is not a macro repetition operator") - .emit(); - } else { - sess.span_diagnostic.span_err( - span, - "the `?` macro repetition operator does not take a separator", - ); - } + sess.span_diagnostic.span_err( + span, + "the `?` macro repetition operator does not take a separator", + ); // Return a dummy return (None, KleeneOp::ZeroOrMore); @@ -638,13 +611,8 @@ where }; // If we ever get to this point, we have experienced an "unexpected token" error - - if !features.macro_at_most_once_rep && !attr::contains_name(attrs, "allow_internal_unstable") { - sess.span_diagnostic.span_err(span, "expected `*` or `+`"); - } else { - sess.span_diagnostic - .span_err(span, "expected one of: `*`, `+`, or `?`"); - } + sess.span_diagnostic + .span_err(span, "expected one of: `*`, `+`, or `?`"); // Return a dummy (None, KleeneOp::ZeroOrMore) diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index cd503f25cfe..3bc34917051 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -1426,9 +1426,6 @@ pub const EXPLAIN_DERIVE_UNDERSCORE: &'static str = pub const EXPLAIN_UNSIZED_TUPLE_COERCION: &'static str = "unsized tuple coercion is not stable enough for use and is subject to change"; -pub const EXPLAIN_MACRO_AT_MOST_ONCE_REP: &'static str = - "using the `?` macro Kleene operator for \"at most one\" repetition is unstable"; - struct PostExpansionVisitor<'a> { context: &'a Context<'a>, } |
