From c75ed34732f67ce41faf84e22e4896cabab14a40 Mon Sep 17 00:00:00 2001 From: Mark Mansi Date: Sat, 24 Nov 2018 16:09:37 -0600 Subject: [PATCH 1/8] move feature gate to accepted --- src/libsyntax/feature_gate.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 73567765a04c4..cd503f25cfe68 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -393,9 +393,6 @@ declare_features! ( // `extern` in paths (active, extern_in_paths, "1.23.0", Some(55600), None), - // Use `?` as the Kleene "at most one" operator - (active, macro_at_most_once_rep, "1.25.0", Some(48075), None), - // Infer static outlives requirements; RFC 2093 (active, infer_static_outlives_requirements, "1.26.0", Some(54185), None), @@ -689,6 +686,8 @@ declare_features! ( (accepted, extern_crate_item_prelude, "1.31.0", Some(55599), None), // Allows use of the :literal macro fragment specifier (RFC 1576) (accepted, macro_literal_matcher, "1.31.0", Some(35625), None), + // Use `?` as the Kleene "at most one" operator + (accepted, macro_at_most_once_rep, "1.32.0", Some(48075), None), ); // If you change this, please modify src/doc/unstable-book as well. You must From a542e48871e040ea2db3b4fad5d88a83b6200855 Mon Sep 17 00:00:00 2001 From: Mark Mansi Date: Sat, 24 Nov 2018 16:12:16 -0600 Subject: [PATCH 2/8] remove feature gate --- src/libsyntax/ext/tt/quoted.rs | 46 ++++++---------------------------- 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 218486748315d..c8ece7b3a88fd 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 cd503f25cfe68..3bc349170514c 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>, } From 32aafb220313fbc91e8f55b12886d77d3e1cf24b Mon Sep 17 00:00:00 2001 From: Mark Mansi Date: Sat, 24 Nov 2018 16:20:25 -0600 Subject: [PATCH 3/8] remove some unused vars --- src/libsyntax/ext/tt/quoted.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libsyntax/ext/tt/quoted.rs b/src/libsyntax/ext/tt/quoted.rs index c8ece7b3a88fd..edc431be3694b 100644 --- a/src/libsyntax/ext/tt/quoted.rs +++ b/src/libsyntax/ext/tt/quoted.rs @@ -11,13 +11,13 @@ use ast::NodeId; use early_buffered_lints::BufferedEarlyLintId; use ext::tt::macro_parser; -use feature_gate::{self, emit_feature_err, Features, GateIssue}; +use feature_gate::Features; use parse::{token, ParseSess}; use print::pprust; use symbol::keywords; use syntax_pos::{edition::Edition, BytePos, Span}; use tokenstream::{self, DelimSpan}; -use {ast, attr}; +use ast; use rustc_data_structures::sync::Lrc; use std::iter::Peekable; @@ -566,8 +566,8 @@ fn parse_sep_and_kleene_op_2018( input: &mut Peekable, span: Span, sess: &ParseSess, - features: &Features, - attrs: &[ast::Attribute], + _features: &Features, + _attrs: &[ast::Attribute], ) -> (Option, KleeneOp) where I: Iterator, @@ -575,7 +575,7 @@ where // We basically look at two token trees here, denoted as #1 and #2 below let span = match parse_kleene_op(input, span) { // #1 is a `?` (needs feature gate) - Ok(Ok((op, op1_span))) if op == KleeneOp::ZeroOrOne => { + Ok(Ok((op, _op1_span))) if op == KleeneOp::ZeroOrOne => { return (None, op); } @@ -585,7 +585,7 @@ where // #1 is a separator followed by #2, a KleeneOp Ok(Err((tok, span))) => match parse_kleene_op(input, span) { // #2 is the `?` Kleene op, which does not take a separator (error) - Ok(Ok((op, op2_span))) if op == KleeneOp::ZeroOrOne => { + Ok(Ok((op, _op2_span))) if op == KleeneOp::ZeroOrOne => { // Error! sess.span_diagnostic.span_err( span, From e97edad935c8eb05d0c67475e81dbb0618ac72fb Mon Sep 17 00:00:00 2001 From: Mark Mansi Date: Sat, 24 Nov 2018 16:27:13 -0600 Subject: [PATCH 4/8] update tests --- ...ost-once-rep-2015-ques-rep-feature-flag.rs | 28 ------- ...once-rep-2015-ques-rep-feature-flag.stderr | 18 ----- ...acro-at-most-once-rep-2018-feature-gate.rs | 45 ----------- ...-at-most-once-rep-2018-feature-gate.stderr | 80 ------------------- .../ui/macros/macro-at-most-once-rep-2018.rs | 12 ++- .../macros/macro-at-most-once-rep-2018.stderr | 22 ++--- 6 files changed, 16 insertions(+), 189 deletions(-) delete mode 100644 src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep-feature-flag.rs delete mode 100644 src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep-feature-flag.stderr delete mode 100644 src/test/ui/macros/macro-at-most-once-rep-2018-feature-gate.rs delete mode 100644 src/test/ui/macros/macro-at-most-once-rep-2018-feature-gate.stderr diff --git a/src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep-feature-flag.rs b/src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep-feature-flag.rs deleted file mode 100644 index 63a4ef16a2581..0000000000000 --- a/src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep-feature-flag.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test behavior of `?` macro _kleene op_ under the 2015 edition. Namely, it doesn't exist, even -// with the feature flag. - -// gate-test-macro_at_most_once_rep -// edition:2015 - -#![feature(macro_at_most_once_rep)] - -macro_rules! bar { - ($(a)?) => {} //~ERROR expected `*` or `+` -} - -macro_rules! baz { - ($(a),?) => {} //~ERROR expected `*` or `+` -} - -fn main() {} - diff --git a/src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep-feature-flag.stderr b/src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep-feature-flag.stderr deleted file mode 100644 index 5f687900421bf..0000000000000 --- a/src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep-feature-flag.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error: expected `*` or `+` - --> $DIR/macro-at-most-once-rep-2015-ques-rep-feature-flag.rs:20:10 - | -LL | ($(a)?) => {} //~ERROR expected `*` or `+` - | ^ - | - = note: `?` is not a macro repetition operator - -error: expected `*` or `+` - --> $DIR/macro-at-most-once-rep-2015-ques-rep-feature-flag.rs:24:11 - | -LL | ($(a),?) => {} //~ERROR expected `*` or `+` - | ^ - | - = note: `?` is not a macro repetition operator - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/macros/macro-at-most-once-rep-2018-feature-gate.rs b/src/test/ui/macros/macro-at-most-once-rep-2018-feature-gate.rs deleted file mode 100644 index ffabf9bcdf685..0000000000000 --- a/src/test/ui/macros/macro-at-most-once-rep-2018-feature-gate.rs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Feature gate test for macro_at_most_once_rep under 2018 edition. - -// gate-test-macro_at_most_once_rep -// edition:2018 - -macro_rules! foo { - ($(a)?) => {} - //~^ERROR using the `?` macro Kleene operator for - //~|ERROR expected `*` or `+` -} - -macro_rules! baz { - ($(a),?) => {} //~ERROR expected `*` or `+` -} - -macro_rules! barplus { - ($(a)?+) => {} - //~^ERROR using the `?` macro Kleene operator for - //~|ERROR expected `*` or `+` -} - -macro_rules! barstar { - ($(a)?*) => {} - //~^ERROR using the `?` macro Kleene operator for - //~|ERROR expected `*` or `+` -} - -pub fn main() { - foo!(); - foo!(a); - foo!(a?); //~ ERROR no rules expected the token `?` - foo!(a?a); //~ ERROR no rules expected the token `?` - foo!(a?a?a); //~ ERROR no rules expected the token `?` -} - diff --git a/src/test/ui/macros/macro-at-most-once-rep-2018-feature-gate.stderr b/src/test/ui/macros/macro-at-most-once-rep-2018-feature-gate.stderr deleted file mode 100644 index 27dc03e1c3981..0000000000000 --- a/src/test/ui/macros/macro-at-most-once-rep-2018-feature-gate.stderr +++ /dev/null @@ -1,80 +0,0 @@ -error[E0658]: using the `?` macro Kleene operator for "at most one" repetition is unstable (see issue #48075) - --> $DIR/macro-at-most-once-rep-2018-feature-gate.rs:17:10 - | -LL | ($(a)?) => {} - | ^ - | - = help: add #![feature(macro_at_most_once_rep)] to the crate attributes to enable - -error: expected `*` or `+` - --> $DIR/macro-at-most-once-rep-2018-feature-gate.rs:17:10 - | -LL | ($(a)?) => {} - | ^ - -error: expected `*` or `+` - --> $DIR/macro-at-most-once-rep-2018-feature-gate.rs:23:11 - | -LL | ($(a),?) => {} //~ERROR expected `*` or `+` - | ^ - | - = note: `?` is not a macro repetition operator - -error[E0658]: using the `?` macro Kleene operator for "at most one" repetition is unstable (see issue #48075) - --> $DIR/macro-at-most-once-rep-2018-feature-gate.rs:27:10 - | -LL | ($(a)?+) => {} - | ^ - | - = help: add #![feature(macro_at_most_once_rep)] to the crate attributes to enable - -error: expected `*` or `+` - --> $DIR/macro-at-most-once-rep-2018-feature-gate.rs:27:10 - | -LL | ($(a)?+) => {} - | ^ - -error[E0658]: using the `?` macro Kleene operator for "at most one" repetition is unstable (see issue #48075) - --> $DIR/macro-at-most-once-rep-2018-feature-gate.rs:33:10 - | -LL | ($(a)?*) => {} - | ^ - | - = help: add #![feature(macro_at_most_once_rep)] to the crate attributes to enable - -error: expected `*` or `+` - --> $DIR/macro-at-most-once-rep-2018-feature-gate.rs:33:10 - | -LL | ($(a)?*) => {} - | ^ - -error: no rules expected the token `?` - --> $DIR/macro-at-most-once-rep-2018-feature-gate.rs:41:11 - | -LL | macro_rules! foo { - | ---------------- when calling this macro -... -LL | foo!(a?); //~ ERROR no rules expected the token `?` - | ^ no rules expected this token in macro call - -error: no rules expected the token `?` - --> $DIR/macro-at-most-once-rep-2018-feature-gate.rs:42:11 - | -LL | macro_rules! foo { - | ---------------- when calling this macro -... -LL | foo!(a?a); //~ ERROR no rules expected the token `?` - | ^ no rules expected this token in macro call - -error: no rules expected the token `?` - --> $DIR/macro-at-most-once-rep-2018-feature-gate.rs:43:11 - | -LL | macro_rules! foo { - | ---------------- when calling this macro -... -LL | foo!(a?a?a); //~ ERROR no rules expected the token `?` - | ^ no rules expected this token in macro call - -error: aborting due to 10 previous errors - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/macros/macro-at-most-once-rep-2018.rs b/src/test/ui/macros/macro-at-most-once-rep-2018.rs index 5dabe8d952801..d8012c05acf8f 100644 --- a/src/test/ui/macros/macro-at-most-once-rep-2018.rs +++ b/src/test/ui/macros/macro-at-most-once-rep-2018.rs @@ -12,22 +12,20 @@ // edition:2018 -#![feature(macro_at_most_once_rep)] - macro_rules! foo { - ($(a)?) => {} + ($(a)?) => {}; } macro_rules! baz { - ($(a),?) => {} //~ERROR the `?` macro repetition operator + ($(a),?) => {}; //~ERROR the `?` macro repetition operator } macro_rules! barplus { - ($(a)?+) => {} // ok. matches "a+" and "+" + ($(a)?+) => {}; // ok. matches "a+" and "+" } macro_rules! barstar { - ($(a)?*) => {} // ok. matches "a*" and "*" + ($(a)?*) => {}; // ok. matches "a*" and "*" } pub fn main() { @@ -41,7 +39,7 @@ pub fn main() { barplus!(a); //~ERROR unexpected end of macro invocation barplus!(a?); //~ ERROR no rules expected the token `?` barplus!(a?a); //~ ERROR no rules expected the token `?` - barplus!(a+); + barplus!(a); barplus!(+); barstar!(); //~ERROR unexpected end of macro invocation diff --git a/src/test/ui/macros/macro-at-most-once-rep-2018.stderr b/src/test/ui/macros/macro-at-most-once-rep-2018.stderr index d363b672680ee..efe0a2672c83c 100644 --- a/src/test/ui/macros/macro-at-most-once-rep-2018.stderr +++ b/src/test/ui/macros/macro-at-most-once-rep-2018.stderr @@ -1,11 +1,11 @@ error: the `?` macro repetition operator does not take a separator - --> $DIR/macro-at-most-once-rep-2018.rs:22:10 + --> $DIR/macro-at-most-once-rep-2018.rs:20:10 | LL | ($(a),?) => {} //~ERROR the `?` macro repetition operator | ^ error: no rules expected the token `?` - --> $DIR/macro-at-most-once-rep-2018.rs:36:11 + --> $DIR/macro-at-most-once-rep-2018.rs:34:11 | LL | macro_rules! foo { | ---------------- when calling this macro @@ -14,7 +14,7 @@ LL | foo!(a?); //~ ERROR no rules expected the token `?` | ^ no rules expected this token in macro call error: no rules expected the token `?` - --> $DIR/macro-at-most-once-rep-2018.rs:37:11 + --> $DIR/macro-at-most-once-rep-2018.rs:35:11 | LL | macro_rules! foo { | ---------------- when calling this macro @@ -23,7 +23,7 @@ LL | foo!(a?a); //~ ERROR no rules expected the token `?` | ^ no rules expected this token in macro call error: no rules expected the token `?` - --> $DIR/macro-at-most-once-rep-2018.rs:38:11 + --> $DIR/macro-at-most-once-rep-2018.rs:36:11 | LL | macro_rules! foo { | ---------------- when calling this macro @@ -32,7 +32,7 @@ LL | foo!(a?a?a); //~ ERROR no rules expected the token `?` | ^ no rules expected this token in macro call error: unexpected end of macro invocation - --> $DIR/macro-at-most-once-rep-2018.rs:40:5 + --> $DIR/macro-at-most-once-rep-2018.rs:38:5 | LL | macro_rules! barplus { | -------------------- when calling this macro @@ -50,7 +50,7 @@ LL | barplus!(a); //~ERROR unexpected end of macro invocation | ^ missing tokens in macro arguments error: no rules expected the token `?` - --> $DIR/macro-at-most-once-rep-2018.rs:42:15 + --> $DIR/macro-at-most-once-rep-2018.rs:40:15 | LL | macro_rules! barplus { | -------------------- when calling this macro @@ -59,7 +59,7 @@ LL | barplus!(a?); //~ ERROR no rules expected the token `?` | ^ no rules expected this token in macro call error: no rules expected the token `?` - --> $DIR/macro-at-most-once-rep-2018.rs:43:15 + --> $DIR/macro-at-most-once-rep-2018.rs:41:15 | LL | macro_rules! barplus { | -------------------- when calling this macro @@ -68,7 +68,7 @@ LL | barplus!(a?a); //~ ERROR no rules expected the token `?` | ^ no rules expected this token in macro call error: unexpected end of macro invocation - --> $DIR/macro-at-most-once-rep-2018.rs:47:5 + --> $DIR/macro-at-most-once-rep-2018.rs:45:5 | LL | macro_rules! barstar { | -------------------- when calling this macro @@ -77,7 +77,7 @@ LL | barstar!(); //~ERROR unexpected end of macro invocation | ^^^^^^^^^^^ missing tokens in macro arguments error: unexpected end of macro invocation - --> $DIR/macro-at-most-once-rep-2018.rs:48:15 + --> $DIR/macro-at-most-once-rep-2018.rs:46:14 | LL | macro_rules! barstar { | -------------------- when calling this macro @@ -86,7 +86,7 @@ LL | barstar!(a); //~ERROR unexpected end of macro invocation | ^ missing tokens in macro arguments error: no rules expected the token `?` - --> $DIR/macro-at-most-once-rep-2018.rs:49:15 + --> $DIR/macro-at-most-once-rep-2018.rs:47:15 | LL | macro_rules! barstar { | -------------------- when calling this macro @@ -95,7 +95,7 @@ LL | barstar!(a?); //~ ERROR no rules expected the token `?` | ^ no rules expected this token in macro call error: no rules expected the token `?` - --> $DIR/macro-at-most-once-rep-2018.rs:50:15 + --> $DIR/macro-at-most-once-rep-2018.rs:48:15 | LL | macro_rules! barstar { | -------------------- when calling this macro From f3b29ca1c21b1cd559441a57e1ff2b8a41d56e36 Mon Sep 17 00:00:00 2001 From: Mark Mansi Date: Sat, 24 Nov 2018 16:29:43 -0600 Subject: [PATCH 5/8] remove unstable book entry --- .../macro-at-most-once-rep.md | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 src/doc/unstable-book/src/language-features/macro-at-most-once-rep.md diff --git a/src/doc/unstable-book/src/language-features/macro-at-most-once-rep.md b/src/doc/unstable-book/src/language-features/macro-at-most-once-rep.md deleted file mode 100644 index 251fc7209122c..0000000000000 --- a/src/doc/unstable-book/src/language-features/macro-at-most-once-rep.md +++ /dev/null @@ -1,22 +0,0 @@ -# `macro_at_most_once_rep` - -NOTE: This feature is only available in the 2018 Edition. - -The tracking issue for this feature is: #48075 - -With this feature gate enabled, one can use `?` as a Kleene operator meaning "0 -or 1 repetitions" in a macro definition. Previously only `+` and `*` were allowed. - -For example: - -```rust,ignore -#![feature(macro_at_most_once_rep)] - -macro_rules! foo { - (something $(,)?) // `?` indicates `,` is "optional"... - => {} -} -``` - ------------------------- - From 59ae93daed93024a3dd413132451f246863f6f97 Mon Sep 17 00:00:00 2001 From: Mark Mansi Date: Sat, 24 Nov 2018 17:26:15 -0600 Subject: [PATCH 6/8] remove uses of feature gate --- src/doc/unstable-book/src/language-features/plugin.md | 1 - src/libcore/lib.rs | 1 - src/librustc/lib.rs | 1 - src/librustc_lint/lib.rs | 1 - src/librustc_metadata/lib.rs | 1 - src/libsyntax/lib.rs | 1 - src/test/compile-fail-fulldeps/auxiliary/lint_for_crate.rs | 1 - .../compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs | 1 - src/test/compile-fail-fulldeps/auxiliary/lint_plugin_test.rs | 1 - src/test/run-pass-fulldeps/auxiliary/lint_for_crate.rs | 1 - .../proc-macro/auxiliary/issue-40001-plugin.rs | 1 - src/test/run-pass/macros/macro-at-most-once-rep.rs | 2 -- src/test/ui-fulldeps/auxiliary/lint_group_plugin_test.rs | 1 - src/test/ui-fulldeps/auxiliary/lint_plugin_test.rs | 1 - src/test/ui-fulldeps/auxiliary/lint_tool_test.rs | 1 - 15 files changed, 16 deletions(-) diff --git a/src/doc/unstable-book/src/language-features/plugin.md b/src/doc/unstable-book/src/language-features/plugin.md index 74bdd4dc3b599..03ea392c86307 100644 --- a/src/doc/unstable-book/src/language-features/plugin.md +++ b/src/doc/unstable-book/src/language-features/plugin.md @@ -181,7 +181,6 @@ that warns about any item named `lintme`. ```rust,ignore #![feature(plugin_registrar)] #![feature(box_syntax, rustc_private)] -#![feature(macro_at_most_once_rep)] extern crate syntax; diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index a02b5bc87c5e9..726e891df0ccf 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -93,7 +93,6 @@ #![feature(never_type)] #![feature(nll)] #![feature(exhaustive_patterns)] -#![feature(macro_at_most_once_rep)] #![feature(no_core)] #![feature(on_unimplemented)] #![feature(optin_builtin_traits)] diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 0aa964a44fd2c..9ae59242fbfa5 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -67,7 +67,6 @@ #![feature(integer_atomics)] #![feature(test)] #![feature(in_band_lifetimes)] -#![feature(macro_at_most_once_rep)] #![feature(crate_visibility_modifier)] #![feature(transpose_result)] diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index 57cbecb5c67be..71efc5654eff3 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -29,7 +29,6 @@ #![feature(nll)] #![feature(quote)] #![feature(rustc_diagnostic_macros)] -#![feature(macro_at_most_once_rep)] #[macro_use] extern crate syntax; diff --git a/src/librustc_metadata/lib.rs b/src/librustc_metadata/lib.rs index 0322c888ad5c9..ee99f7465b905 100644 --- a/src/librustc_metadata/lib.rs +++ b/src/librustc_metadata/lib.rs @@ -14,7 +14,6 @@ #![feature(box_patterns)] #![feature(libc)] -#![feature(macro_at_most_once_rep)] #![feature(nll)] #![feature(proc_macro_internals)] #![feature(proc_macro_quote)] diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 9bbd59e09be15..ca9c5ad7b600e 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -20,7 +20,6 @@ test(attr(deny(warnings))))] #![feature(crate_visibility_modifier)] -#![feature(macro_at_most_once_rep)] #![feature(nll)] #![feature(rustc_attrs)] #![feature(rustc_diagnostic_macros)] diff --git a/src/test/compile-fail-fulldeps/auxiliary/lint_for_crate.rs b/src/test/compile-fail-fulldeps/auxiliary/lint_for_crate.rs index 460e28fc794f0..fc53031e7f226 100644 --- a/src/test/compile-fail-fulldeps/auxiliary/lint_for_crate.rs +++ b/src/test/compile-fail-fulldeps/auxiliary/lint_for_crate.rs @@ -12,7 +12,6 @@ #![feature(plugin_registrar, rustc_private)] #![feature(box_syntax)] -#![feature(macro_at_most_once_rep)] #[macro_use] extern crate rustc; extern crate rustc_plugin; diff --git a/src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs b/src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs index 1057649d969d1..f697642f8431d 100644 --- a/src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs +++ b/src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs @@ -12,7 +12,6 @@ #![feature(plugin_registrar)] #![feature(box_syntax, rustc_private)] -#![feature(macro_at_most_once_rep)] // Load rustc as a plugin to get macros #[macro_use] diff --git a/src/test/compile-fail-fulldeps/auxiliary/lint_plugin_test.rs b/src/test/compile-fail-fulldeps/auxiliary/lint_plugin_test.rs index b0183a3c56bc4..8647797270f9a 100644 --- a/src/test/compile-fail-fulldeps/auxiliary/lint_plugin_test.rs +++ b/src/test/compile-fail-fulldeps/auxiliary/lint_plugin_test.rs @@ -12,7 +12,6 @@ #![feature(plugin_registrar)] #![feature(box_syntax, rustc_private)] -#![feature(macro_at_most_once_rep)] extern crate syntax; diff --git a/src/test/run-pass-fulldeps/auxiliary/lint_for_crate.rs b/src/test/run-pass-fulldeps/auxiliary/lint_for_crate.rs index 00c419a8d09e8..9f6927d21640e 100644 --- a/src/test/run-pass-fulldeps/auxiliary/lint_for_crate.rs +++ b/src/test/run-pass-fulldeps/auxiliary/lint_for_crate.rs @@ -12,7 +12,6 @@ #![feature(plugin_registrar, rustc_private)] #![feature(box_syntax)] -#![feature(macro_at_most_once_rep)] #[macro_use] extern crate rustc; extern crate rustc_plugin; diff --git a/src/test/run-pass-fulldeps/proc-macro/auxiliary/issue-40001-plugin.rs b/src/test/run-pass-fulldeps/proc-macro/auxiliary/issue-40001-plugin.rs index e0acf340a79fd..f4d3f2c94caf1 100644 --- a/src/test/run-pass-fulldeps/proc-macro/auxiliary/issue-40001-plugin.rs +++ b/src/test/run-pass-fulldeps/proc-macro/auxiliary/issue-40001-plugin.rs @@ -9,7 +9,6 @@ // except according to those terms. #![feature(box_syntax, plugin, plugin_registrar, rustc_private)] -#![feature(macro_at_most_once_rep)] #![crate_type = "dylib"] #[macro_use] diff --git a/src/test/run-pass/macros/macro-at-most-once-rep.rs b/src/test/run-pass/macros/macro-at-most-once-rep.rs index c7129423cb651..563fd01c11147 100644 --- a/src/test/run-pass/macros/macro-at-most-once-rep.rs +++ b/src/test/run-pass/macros/macro-at-most-once-rep.rs @@ -22,8 +22,6 @@ // edition:2018 -#![feature(macro_at_most_once_rep)] - macro_rules! foo { ($($a:ident)? ; $num:expr) => { { let mut x = 0; diff --git a/src/test/ui-fulldeps/auxiliary/lint_group_plugin_test.rs b/src/test/ui-fulldeps/auxiliary/lint_group_plugin_test.rs index 1057649d969d1..f697642f8431d 100644 --- a/src/test/ui-fulldeps/auxiliary/lint_group_plugin_test.rs +++ b/src/test/ui-fulldeps/auxiliary/lint_group_plugin_test.rs @@ -12,7 +12,6 @@ #![feature(plugin_registrar)] #![feature(box_syntax, rustc_private)] -#![feature(macro_at_most_once_rep)] // Load rustc as a plugin to get macros #[macro_use] diff --git a/src/test/ui-fulldeps/auxiliary/lint_plugin_test.rs b/src/test/ui-fulldeps/auxiliary/lint_plugin_test.rs index b0183a3c56bc4..8647797270f9a 100644 --- a/src/test/ui-fulldeps/auxiliary/lint_plugin_test.rs +++ b/src/test/ui-fulldeps/auxiliary/lint_plugin_test.rs @@ -12,7 +12,6 @@ #![feature(plugin_registrar)] #![feature(box_syntax, rustc_private)] -#![feature(macro_at_most_once_rep)] extern crate syntax; diff --git a/src/test/ui-fulldeps/auxiliary/lint_tool_test.rs b/src/test/ui-fulldeps/auxiliary/lint_tool_test.rs index 7d2acd7aa4c86..0a449e338bd06 100644 --- a/src/test/ui-fulldeps/auxiliary/lint_tool_test.rs +++ b/src/test/ui-fulldeps/auxiliary/lint_tool_test.rs @@ -10,7 +10,6 @@ #![feature(plugin_registrar)] #![feature(box_syntax, rustc_private)] -#![feature(macro_at_most_once_rep)] extern crate syntax; From aeede9eb468f373f2c3250899606b0a68e8b8a18 Mon Sep 17 00:00:00 2001 From: Mark Mansi Date: Sat, 24 Nov 2018 18:40:03 -0600 Subject: [PATCH 7/8] fix test --- src/test/ui/macros/macro-at-most-once-rep-2018.rs | 2 +- src/test/ui/macros/macro-at-most-once-rep-2018.stderr | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/ui/macros/macro-at-most-once-rep-2018.rs b/src/test/ui/macros/macro-at-most-once-rep-2018.rs index d8012c05acf8f..78bdf8ff71b88 100644 --- a/src/test/ui/macros/macro-at-most-once-rep-2018.rs +++ b/src/test/ui/macros/macro-at-most-once-rep-2018.rs @@ -39,7 +39,7 @@ pub fn main() { barplus!(a); //~ERROR unexpected end of macro invocation barplus!(a?); //~ ERROR no rules expected the token `?` barplus!(a?a); //~ ERROR no rules expected the token `?` - barplus!(a); + barplus!(a+); barplus!(+); barstar!(); //~ERROR unexpected end of macro invocation diff --git a/src/test/ui/macros/macro-at-most-once-rep-2018.stderr b/src/test/ui/macros/macro-at-most-once-rep-2018.stderr index efe0a2672c83c..43779078ebc83 100644 --- a/src/test/ui/macros/macro-at-most-once-rep-2018.stderr +++ b/src/test/ui/macros/macro-at-most-once-rep-2018.stderr @@ -1,7 +1,7 @@ error: the `?` macro repetition operator does not take a separator --> $DIR/macro-at-most-once-rep-2018.rs:20:10 | -LL | ($(a),?) => {} //~ERROR the `?` macro repetition operator +LL | ($(a),?) => {}; //~ERROR the `?` macro repetition operator | ^ error: no rules expected the token `?` From 5d7717360c8f343f70a33455029355f00e39dea2 Mon Sep 17 00:00:00 2001 From: Mark Mansi Date: Tue, 27 Nov 2018 18:21:10 -0600 Subject: [PATCH 8/8] fix test --- src/test/ui/macros/macro-at-most-once-rep-2018.stderr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/ui/macros/macro-at-most-once-rep-2018.stderr b/src/test/ui/macros/macro-at-most-once-rep-2018.stderr index 43779078ebc83..da76d1ff1a721 100644 --- a/src/test/ui/macros/macro-at-most-once-rep-2018.stderr +++ b/src/test/ui/macros/macro-at-most-once-rep-2018.stderr @@ -41,7 +41,7 @@ LL | barplus!(); //~ERROR unexpected end of macro invocation | ^^^^^^^^^^^ missing tokens in macro arguments error: unexpected end of macro invocation - --> $DIR/macro-at-most-once-rep-2018.rs:41:15 + --> $DIR/macro-at-most-once-rep-2018.rs:39:15 | LL | macro_rules! barplus { | -------------------- when calling this macro @@ -77,7 +77,7 @@ LL | barstar!(); //~ERROR unexpected end of macro invocation | ^^^^^^^^^^^ missing tokens in macro arguments error: unexpected end of macro invocation - --> $DIR/macro-at-most-once-rep-2018.rs:46:14 + --> $DIR/macro-at-most-once-rep-2018.rs:46:15 | LL | macro_rules! barstar { | -------------------- when calling this macro