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 63a4ef16a25..00000000000 --- 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 5f687900421..00000000000 --- 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 ffabf9bcdf6..00000000000 --- 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 27dc03e1c39..00000000000 --- 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 5dabe8d9528..d8012c05acf 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 d363b672680..efe0a2672c8 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