about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-06-09 05:00:22 +0000
committerbors <bors@rust-lang.org>2019-06-09 05:00:22 +0000
commite6e60ef6ea7f4249fd9b4b4a855570301ce160dd (patch)
tree336e5b0951c55cebacd0d5673413a5895ec39654 /src/test
parent57e13e0325c1d41161a31de1f8520538ec2c575c (diff)
parent3ba82f7cd8f74d73ebbdcd45aefc761f518f782d (diff)
downloadrust-e6e60ef6ea7f4249fd9b4b4a855570301ce160dd.tar.gz
rust-e6e60ef6ea7f4249fd9b4b4a855570301ce160dd.zip
Auto merge of #60932 - Centril:macro-at-most-once-2015, r=mark-i-m
Support ? Kleene macro operator in 2015

Closes https://github.com/rust-lang/rust/issues/56668.

See that issue for rationale and discussion.

Crater will be needed (done in https://github.com/rust-lang/rust/pull/60932#issuecomment-494188577, zero regressions) and then, if all goes well, FCP (in https://github.com/rust-lang/rust/pull/60932#issuecomment-494189802).
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/macros/macro-at-most-once-rep-2015.rs50
-rw-r--r--src/test/run-pass/macros/macro-at-most-once-rep-2018.rs50
-rw-r--r--src/test/run-pass/macros/macro-at-most-once-rep.rs33
-rw-r--r--src/test/ui/issues/issue-39388.rs2
-rw-r--r--src/test/ui/issues/issue-39388.stderr2
-rw-r--r--src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep.rs13
-rw-r--r--src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep.stderr18
-rw-r--r--src/test/ui/macros/macro-at-most-once-rep-2015-ques-sep.rs28
-rw-r--r--src/test/ui/macros/macro-at-most-once-rep-2015-ques-sep.stderr24
-rw-r--r--src/test/ui/macros/macro-at-most-once-rep-2015.rs42
-rw-r--r--src/test/ui/macros/macro-at-most-once-rep-2015.stderr107
-rw-r--r--src/test/ui/macros/macro-at-most-once-rep-2018.rs1
-rw-r--r--src/test/ui/macros/macro-at-most-once-rep-2018.stderr24
-rw-r--r--src/test/ui/parser/macro/issue-33569.rs2
-rw-r--r--src/test/ui/parser/macro/issue-33569.stderr2
15 files changed, 266 insertions, 132 deletions
diff --git a/src/test/run-pass/macros/macro-at-most-once-rep-2015.rs b/src/test/run-pass/macros/macro-at-most-once-rep-2015.rs
new file mode 100644
index 00000000000..66597c0acf6
--- /dev/null
+++ b/src/test/run-pass/macros/macro-at-most-once-rep-2015.rs
@@ -0,0 +1,50 @@
+// run-pass
+
+#![allow(unused_mut)]
+
+// Check that when `?` is followed by what looks like a Kleene operator (?, +, and *)
+// then that `?` is not interpreted as a separator. In other words, `$(pat)?+` matches `pat +`
+// or `+` but does not match `pat` or `pat ? pat`.
+
+// edition:2015
+
+macro_rules! foo {
+    // Check for `?`.
+    ($($a:ident)? ? $num:expr) => {
+        foo!($($a)? ; $num);
+    };
+    // Check for `+`.
+    ($($a:ident)? + $num:expr) => {
+        foo!($($a)? ; $num);
+    };
+    // Check for `*`.
+    ($($a:ident)? * $num:expr) => {
+        foo!($($a)? ; $num);
+    };
+    // Check for `;`, not a kleene operator.
+    ($($a:ident)? ; $num:expr) => {
+        let mut x = 0;
+
+        $(
+            x += $a;
+        )?
+
+        assert_eq!(x, $num);
+    };
+}
+
+pub fn main() {
+    let a = 1;
+
+    // Accept 0 repetitions.
+    foo!( ; 0);
+    foo!( + 0);
+    foo!( * 0);
+    foo!( ? 0);
+
+    // Accept 1 repetition.
+    foo!(a ; 1);
+    foo!(a + 1);
+    foo!(a * 1);
+    foo!(a ? 1);
+}
diff --git a/src/test/run-pass/macros/macro-at-most-once-rep-2018.rs b/src/test/run-pass/macros/macro-at-most-once-rep-2018.rs
new file mode 100644
index 00000000000..b37f3853016
--- /dev/null
+++ b/src/test/run-pass/macros/macro-at-most-once-rep-2018.rs
@@ -0,0 +1,50 @@
+// run-pass
+
+#![allow(unused_mut)]
+
+// Check that when `?` is followed by what looks like a Kleene operator (?, +, and *)
+// then that `?` is not interpreted as a separator. In other words, `$(pat)?+` matches `pat +`
+// or `+` but does not match `pat` or `pat ? pat`.
+
+// edition:2018
+
+macro_rules! foo {
+    // Check for `?`.
+    ($($a:ident)? ? $num:expr) => {
+        foo!($($a)? ; $num);
+    };
+    // Check for `+`.
+    ($($a:ident)? + $num:expr) => {
+        foo!($($a)? ; $num);
+    };
+    // Check for `*`.
+    ($($a:ident)? * $num:expr) => {
+        foo!($($a)? ; $num);
+    };
+    // Check for `;`, not a kleene operator.
+    ($($a:ident)? ; $num:expr) => {
+        let mut x = 0;
+
+        $(
+            x += $a;
+        )?
+
+        assert_eq!(x, $num);
+    };
+}
+
+pub fn main() {
+    let a = 1;
+
+    // Accept 0 repetitions.
+    foo!( ; 0);
+    foo!( + 0);
+    foo!( * 0);
+    foo!( ? 0);
+
+    // Accept 1 repetition.
+    foo!(a ; 1);
+    foo!(a + 1);
+    foo!(a * 1);
+    foo!(a ? 1);
+}
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
deleted file mode 100644
index 582ef088a73..00000000000
--- a/src/test/run-pass/macros/macro-at-most-once-rep.rs
+++ /dev/null
@@ -1,33 +0,0 @@
-// run-pass
-#![allow(unused_mut)]
-// The logic for parsing Kleene operators in macros has a special case to disambiguate `?`.
-// Specifically, `$(pat)?` is the ZeroOrOne operator whereas `$(pat)?+` or `$(pat)?*` are the
-// ZeroOrMore and OneOrMore operators using `?` as a separator. These tests are intended to
-// exercise that logic in the macro parser.
-//
-// Moreover, we also throw in some tests for using a separator with `?`, which is meaningless but
-// included for consistency with `+` and `*`.
-//
-// This test focuses on non-error cases and making sure the correct number of repetitions happen.
-
-// edition:2018
-
-macro_rules! foo {
-    ($($a:ident)? ; $num:expr) => { {
-        let mut x = 0;
-
-        $(
-            x += $a;
-         )?
-
-        assert_eq!(x, $num);
-    } }
-}
-
-pub fn main() {
-    let a = 1;
-
-    // accept 0 or 1 repetitions
-    foo!( ; 0);
-    foo!(a ; 1);
-}
diff --git a/src/test/ui/issues/issue-39388.rs b/src/test/ui/issues/issue-39388.rs
index e5b1cd93614..a8e31a648c9 100644
--- a/src/test/ui/issues/issue-39388.rs
+++ b/src/test/ui/issues/issue-39388.rs
@@ -1,7 +1,7 @@
 #![allow(unused_macros)]
 
 macro_rules! assign {
-    (($($a:tt)*) = ($($b:tt))*) => { //~ ERROR expected `*` or `+`
+    (($($a:tt)*) = ($($b:tt))*) => { //~ ERROR expected one of: `*`, `+`, or `?`
         $($a)* = $($b)*
     }
 }
diff --git a/src/test/ui/issues/issue-39388.stderr b/src/test/ui/issues/issue-39388.stderr
index e04e16e2a03..62e7dff5476 100644
--- a/src/test/ui/issues/issue-39388.stderr
+++ b/src/test/ui/issues/issue-39388.stderr
@@ -1,4 +1,4 @@
-error: expected `*` or `+`
+error: expected one of: `*`, `+`, or `?`
   --> $DIR/issue-39388.rs:4:22
    |
 LL |     (($($a:tt)*) = ($($b:tt))*) => {
diff --git a/src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep.rs b/src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep.rs
deleted file mode 100644
index 2d8d2ecf9d7..00000000000
--- a/src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-// Test behavior of `?` macro _kleene op_ under the 2015 edition. Namely, it doesn't exist.
-
-// edition:2015
-
-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.stderr b/src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep.stderr
deleted file mode 100644
index e78f2833078..00000000000
--- a/src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error: expected `*` or `+`
-  --> $DIR/macro-at-most-once-rep-2015-ques-rep.rs:6:10
-   |
-LL |     ($(a)?) => {}
-   |          ^
-   |
-   = note: `?` is not a macro repetition operator in the 2015 edition, but is accepted in the 2018 edition
-
-error: expected `*` or `+`
-  --> $DIR/macro-at-most-once-rep-2015-ques-rep.rs:10:11
-   |
-LL |     ($(a),?) => {}
-   |           ^
-   |
-   = note: `?` is not a macro repetition operator in the 2015 edition, but is accepted in the 2018 edition
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/macros/macro-at-most-once-rep-2015-ques-sep.rs b/src/test/ui/macros/macro-at-most-once-rep-2015-ques-sep.rs
deleted file mode 100644
index c8c920ff3f8..00000000000
--- a/src/test/ui/macros/macro-at-most-once-rep-2015-ques-sep.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-// Test behavior of `?` macro _separator_ under the 2015 edition. Namely, `?` can be used as a
-// separator, but you get a migration warning for the edition.
-
-// edition:2015
-// compile-pass
-
-#![warn(rust_2018_compatibility)]
-
-macro_rules! bar {
-    ($(a)?*) => {} //~WARN using `?` as a separator
-    //~^WARN this was previously accepted
-}
-
-macro_rules! baz {
-    ($(a)?+) => {} //~WARN using `?` as a separator
-    //~^WARN this was previously accepted
-}
-
-fn main() {
-    bar!();
-    bar!(a);
-    bar!(a?a);
-    bar!(a?a?a?a?a);
-
-    baz!(a);
-    baz!(a?a);
-    baz!(a?a?a?a?a);
-}
diff --git a/src/test/ui/macros/macro-at-most-once-rep-2015-ques-sep.stderr b/src/test/ui/macros/macro-at-most-once-rep-2015-ques-sep.stderr
deleted file mode 100644
index bf1861ae540..00000000000
--- a/src/test/ui/macros/macro-at-most-once-rep-2015-ques-sep.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-warning: using `?` as a separator is deprecated and will be a hard error in an upcoming edition
-  --> $DIR/macro-at-most-once-rep-2015-ques-sep.rs:10:10
-   |
-LL |     ($(a)?*) => {}
-   |          ^
-   |
-note: lint level defined here
-  --> $DIR/macro-at-most-once-rep-2015-ques-sep.rs:7:9
-   |
-LL | #![warn(rust_2018_compatibility)]
-   |         ^^^^^^^^^^^^^^^^^^^^^^^
-   = note: #[warn(question_mark_macro_sep)] implied by #[warn(rust_2018_compatibility)]
-   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
-   = note: for more information, see issue #48075 <https://github.com/rust-lang/rust/issues/48075>
-
-warning: using `?` as a separator is deprecated and will be a hard error in an upcoming edition
-  --> $DIR/macro-at-most-once-rep-2015-ques-sep.rs:15:10
-   |
-LL |     ($(a)?+) => {}
-   |          ^
-   |
-   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
-   = note: for more information, see issue #48075 <https://github.com/rust-lang/rust/issues/48075>
-
diff --git a/src/test/ui/macros/macro-at-most-once-rep-2015.rs b/src/test/ui/macros/macro-at-most-once-rep-2015.rs
new file mode 100644
index 00000000000..f68100d4557
--- /dev/null
+++ b/src/test/ui/macros/macro-at-most-once-rep-2015.rs
@@ -0,0 +1,42 @@
+// Tests that `?` is a Kleene op and not a macro separator in the 2015 edition.
+
+// edition:2015
+
+macro_rules! foo {
+    ($(a)?) => {};
+}
+
+// The Kleene op `?` does not admit a separator before it.
+macro_rules! baz {
+    ($(a),?) => {}; //~ERROR the `?` macro repetition operator
+}
+
+macro_rules! barplus {
+    ($(a)?+) => {}; // ok. matches "a+" and "+"
+}
+
+macro_rules! barstar {
+    ($(a)?*) => {}; // ok. matches "a*" and "*"
+}
+
+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 `?`
+
+    barplus!(); //~ERROR unexpected end of macro invocation
+    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!(+);
+
+    barstar!(); //~ERROR unexpected end of macro invocation
+    barstar!(a); //~ERROR unexpected end of macro invocation
+    barstar!(a?); //~ ERROR no rules expected the token `?`
+    barstar!(a?a); //~ ERROR no rules expected the token `?`
+    barstar!(a*);
+    barstar!(*);
+}
diff --git a/src/test/ui/macros/macro-at-most-once-rep-2015.stderr b/src/test/ui/macros/macro-at-most-once-rep-2015.stderr
new file mode 100644
index 00000000000..f9871ab8ffe
--- /dev/null
+++ b/src/test/ui/macros/macro-at-most-once-rep-2015.stderr
@@ -0,0 +1,107 @@
+error: the `?` macro repetition operator does not take a separator
+  --> $DIR/macro-at-most-once-rep-2015.rs:11:10
+   |
+LL |     ($(a),?) => {};
+   |          ^
+
+error: no rules expected the token `?`
+  --> $DIR/macro-at-most-once-rep-2015.rs:25:11
+   |
+LL | macro_rules! foo {
+   | ---------------- when calling this macro
+...
+LL |     foo!(a?);
+   |           ^ no rules expected this token in macro call
+
+error: no rules expected the token `?`
+  --> $DIR/macro-at-most-once-rep-2015.rs:26:11
+   |
+LL | macro_rules! foo {
+   | ---------------- when calling this macro
+...
+LL |     foo!(a?a);
+   |           ^ no rules expected this token in macro call
+
+error: no rules expected the token `?`
+  --> $DIR/macro-at-most-once-rep-2015.rs:27:11
+   |
+LL | macro_rules! foo {
+   | ---------------- when calling this macro
+...
+LL |     foo!(a?a?a);
+   |           ^ no rules expected this token in macro call
+
+error: unexpected end of macro invocation
+  --> $DIR/macro-at-most-once-rep-2015.rs:29:5
+   |
+LL | macro_rules! barplus {
+   | -------------------- when calling this macro
+...
+LL |     barplus!();
+   |     ^^^^^^^^^^^ missing tokens in macro arguments
+
+error: unexpected end of macro invocation
+  --> $DIR/macro-at-most-once-rep-2015.rs:30:15
+   |
+LL | macro_rules! barplus {
+   | -------------------- when calling this macro
+...
+LL |     barplus!(a);
+   |               ^ missing tokens in macro arguments
+
+error: no rules expected the token `?`
+  --> $DIR/macro-at-most-once-rep-2015.rs:31:15
+   |
+LL | macro_rules! barplus {
+   | -------------------- when calling this macro
+...
+LL |     barplus!(a?);
+   |               ^ no rules expected this token in macro call
+
+error: no rules expected the token `?`
+  --> $DIR/macro-at-most-once-rep-2015.rs:32:15
+   |
+LL | macro_rules! barplus {
+   | -------------------- when calling this macro
+...
+LL |     barplus!(a?a);
+   |               ^ no rules expected this token in macro call
+
+error: unexpected end of macro invocation
+  --> $DIR/macro-at-most-once-rep-2015.rs:36:5
+   |
+LL | macro_rules! barstar {
+   | -------------------- when calling this macro
+...
+LL |     barstar!();
+   |     ^^^^^^^^^^^ missing tokens in macro arguments
+
+error: unexpected end of macro invocation
+  --> $DIR/macro-at-most-once-rep-2015.rs:37:15
+   |
+LL | macro_rules! barstar {
+   | -------------------- when calling this macro
+...
+LL |     barstar!(a);
+   |               ^ missing tokens in macro arguments
+
+error: no rules expected the token `?`
+  --> $DIR/macro-at-most-once-rep-2015.rs:38:15
+   |
+LL | macro_rules! barstar {
+   | -------------------- when calling this macro
+...
+LL |     barstar!(a?);
+   |               ^ no rules expected this token in macro call
+
+error: no rules expected the token `?`
+  --> $DIR/macro-at-most-once-rep-2015.rs:39:15
+   |
+LL | macro_rules! barstar {
+   | -------------------- when calling this macro
+...
+LL |     barstar!(a?a);
+   |               ^ no rules expected this token in macro call
+
+error: aborting due to 12 previous errors
+
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 da072adec15..886a25bbcbc 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
@@ -6,6 +6,7 @@ macro_rules! foo {
     ($(a)?) => {};
 }
 
+// The Kleene op `?` does not admit a separator before it.
 macro_rules! baz {
     ($(a),?) => {}; //~ERROR the `?` macro repetition operator
 }
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 f285c7cc7c2..bfe5883b03f 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:10:10
+  --> $DIR/macro-at-most-once-rep-2018.rs:11:10
    |
 LL |     ($(a),?) => {};
    |          ^
 
 error: no rules expected the token `?`
-  --> $DIR/macro-at-most-once-rep-2018.rs:24:11
+  --> $DIR/macro-at-most-once-rep-2018.rs:25:11
    |
 LL | macro_rules! foo {
    | ---------------- when calling this macro
@@ -14,7 +14,7 @@ LL |     foo!(a?);
    |           ^ no rules expected this token in macro call
 
 error: no rules expected the token `?`
-  --> $DIR/macro-at-most-once-rep-2018.rs:25:11
+  --> $DIR/macro-at-most-once-rep-2018.rs:26:11
    |
 LL | macro_rules! foo {
    | ---------------- when calling this macro
@@ -23,7 +23,7 @@ LL |     foo!(a?a);
    |           ^ no rules expected this token in macro call
 
 error: no rules expected the token `?`
-  --> $DIR/macro-at-most-once-rep-2018.rs:26:11
+  --> $DIR/macro-at-most-once-rep-2018.rs:27:11
    |
 LL | macro_rules! foo {
    | ---------------- when calling this macro
@@ -32,7 +32,7 @@ LL |     foo!(a?a?a);
    |           ^ no rules expected this token in macro call
 
 error: unexpected end of macro invocation
-  --> $DIR/macro-at-most-once-rep-2018.rs:28:5
+  --> $DIR/macro-at-most-once-rep-2018.rs:29:5
    |
 LL | macro_rules! barplus {
    | -------------------- when calling this macro
@@ -41,7 +41,7 @@ LL |     barplus!();
    |     ^^^^^^^^^^^ missing tokens in macro arguments
 
 error: unexpected end of macro invocation
-  --> $DIR/macro-at-most-once-rep-2018.rs:29:15
+  --> $DIR/macro-at-most-once-rep-2018.rs:30:15
    |
 LL | macro_rules! barplus {
    | -------------------- when calling this macro
@@ -50,7 +50,7 @@ LL |     barplus!(a);
    |               ^ missing tokens in macro arguments
 
 error: no rules expected the token `?`
-  --> $DIR/macro-at-most-once-rep-2018.rs:30:15
+  --> $DIR/macro-at-most-once-rep-2018.rs:31:15
    |
 LL | macro_rules! barplus {
    | -------------------- when calling this macro
@@ -59,7 +59,7 @@ LL |     barplus!(a?);
    |               ^ no rules expected this token in macro call
 
 error: no rules expected the token `?`
-  --> $DIR/macro-at-most-once-rep-2018.rs:31:15
+  --> $DIR/macro-at-most-once-rep-2018.rs:32:15
    |
 LL | macro_rules! barplus {
    | -------------------- when calling this macro
@@ -68,7 +68,7 @@ LL |     barplus!(a?a);
    |               ^ no rules expected this token in macro call
 
 error: unexpected end of macro invocation
-  --> $DIR/macro-at-most-once-rep-2018.rs:35:5
+  --> $DIR/macro-at-most-once-rep-2018.rs:36:5
    |
 LL | macro_rules! barstar {
    | -------------------- when calling this macro
@@ -77,7 +77,7 @@ LL |     barstar!();
    |     ^^^^^^^^^^^ missing tokens in macro arguments
 
 error: unexpected end of macro invocation
-  --> $DIR/macro-at-most-once-rep-2018.rs:36:15
+  --> $DIR/macro-at-most-once-rep-2018.rs:37:15
    |
 LL | macro_rules! barstar {
    | -------------------- when calling this macro
@@ -86,7 +86,7 @@ LL |     barstar!(a);
    |               ^ missing tokens in macro arguments
 
 error: no rules expected the token `?`
-  --> $DIR/macro-at-most-once-rep-2018.rs:37:15
+  --> $DIR/macro-at-most-once-rep-2018.rs:38:15
    |
 LL | macro_rules! barstar {
    | -------------------- when calling this macro
@@ -95,7 +95,7 @@ LL |     barstar!(a?);
    |               ^ no rules expected this token in macro call
 
 error: no rules expected the token `?`
-  --> $DIR/macro-at-most-once-rep-2018.rs:38:15
+  --> $DIR/macro-at-most-once-rep-2018.rs:39:15
    |
 LL | macro_rules! barstar {
    | -------------------- when calling this macro
diff --git a/src/test/ui/parser/macro/issue-33569.rs b/src/test/ui/parser/macro/issue-33569.rs
index 83f8a562a03..9ed53519ceb 100644
--- a/src/test/ui/parser/macro/issue-33569.rs
+++ b/src/test/ui/parser/macro/issue-33569.rs
@@ -1,7 +1,7 @@
 macro_rules! foo {
     { $+ } => { //~ ERROR expected identifier, found `+`
                 //~^ ERROR missing fragment specifier
-        $(x)(y) //~ ERROR expected `*` or `+`
+        $(x)(y) //~ ERROR expected one of: `*`, `+`, or `?`
     }
 }
 
diff --git a/src/test/ui/parser/macro/issue-33569.stderr b/src/test/ui/parser/macro/issue-33569.stderr
index 8ba72fc8886..b4d38d3ce48 100644
--- a/src/test/ui/parser/macro/issue-33569.stderr
+++ b/src/test/ui/parser/macro/issue-33569.stderr
@@ -4,7 +4,7 @@ error: expected identifier, found `+`
 LL |     { $+ } => {
    |        ^
 
-error: expected `*` or `+`
+error: expected one of: `*`, `+`, or `?`
   --> $DIR/issue-33569.rs:4:13
    |
 LL |         $(x)(y)