Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/tools/tidy/src/issues.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2554,8 +2554,6 @@ ui/suggestions/issue-109991.rs
ui/suggestions/issue-112590-suggest-import.rs
ui/suggestions/issue-114701.rs
ui/suggestions/issue-114797-bad-parentheses-dyn-trait.rs
ui/suggestions/issue-116434-2015.rs
ui/suggestions/issue-116434-2021.rs
ui/suggestions/issue-117669.rs
ui/suggestions/issue-21673.rs
ui/suggestions/issue-51055-missing-semicolon-between-call-and-tuple.rs
Expand Down
50 changes: 0 additions & 50 deletions tests/ui/macros/macro-at-most-once-rep-2018-rpass.rs

This file was deleted.

42 changes: 0 additions & 42 deletions tests/ui/macros/macro-at-most-once-rep-2018.rs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
// 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
//@ revisions: rust2015 rust2018
//@[rust2015] edition:2015
//@[rust2018] edition:2018
Comment on lines +9 to +11
Copy link
Copy Markdown
Member

@Zalathar Zalathar Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: For all of these tests, please add a space after the colon in the edition directive, i.e. edition: 2015 and edition: 2018.

Tests aren't fully consistent in how they write directives, but a space after the colon is the most common style.

View changes since the review


macro_rules! foo {
// Check for `?`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Tests that `?` is a Kleene op and not a macro separator in the 2015 edition.
// Tests that `?` is a Kleene op and not a macro separator in the 2015 & 2018 editions.

//@ edition:2015
//@ revisions: rust2015 rust2018
//@[rust2015] edition:2015
//@[rust2018] edition:2018

macro_rules! foo {
($(a)?) => {};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error: the `?` macro repetition operator does not take a separator
--> $DIR/macro-at-most-once-rep-2018.rs:11:10
--> $DIR/macro-at-most-once-rep.rs:13:10
|
LL | ($(a),?) => {};
| ^

error: no rules expected `?`
--> $DIR/macro-at-most-once-rep-2018.rs:25:11
--> $DIR/macro-at-most-once-rep.rs:27:11
|
LL | macro_rules! foo {
| ---------------- when calling this macro
Expand All @@ -16,7 +16,7 @@ LL | foo!(a?);
= note: while trying to match sequence end

error: no rules expected `?`
--> $DIR/macro-at-most-once-rep-2018.rs:26:11
--> $DIR/macro-at-most-once-rep.rs:28:11
|
LL | macro_rules! foo {
| ---------------- when calling this macro
Expand All @@ -27,7 +27,7 @@ LL | foo!(a?a);
= note: while trying to match sequence end

error: no rules expected `?`
--> $DIR/macro-at-most-once-rep-2018.rs:27:11
--> $DIR/macro-at-most-once-rep.rs:29:11
|
LL | macro_rules! foo {
| ---------------- when calling this macro
Expand All @@ -38,7 +38,7 @@ LL | foo!(a?a?a);
= note: while trying to match sequence end

error: unexpected end of macro invocation
--> $DIR/macro-at-most-once-rep-2018.rs:29:5
--> $DIR/macro-at-most-once-rep.rs:31:5
|
LL | macro_rules! barplus {
| -------------------- when calling this macro
Expand All @@ -47,13 +47,13 @@ LL | barplus!();
| ^^^^^^^^^^ missing tokens in macro arguments
|
note: while trying to match `+`
--> $DIR/macro-at-most-once-rep-2018.rs:15:11
--> $DIR/macro-at-most-once-rep.rs:17:11
|
LL | ($(a)?+) => {}; // ok. matches "a+" and "+"
| ^

error: unexpected end of macro invocation
--> $DIR/macro-at-most-once-rep-2018.rs:30:15
--> $DIR/macro-at-most-once-rep.rs:32:15
|
LL | macro_rules! barplus {
| -------------------- when calling this macro
Expand All @@ -62,13 +62,13 @@ LL | barplus!(a);
| ^ missing tokens in macro arguments
|
note: while trying to match `+`
--> $DIR/macro-at-most-once-rep-2018.rs:15:11
--> $DIR/macro-at-most-once-rep.rs:17:11
|
LL | ($(a)?+) => {}; // ok. matches "a+" and "+"
| ^

error: no rules expected `?`
--> $DIR/macro-at-most-once-rep-2018.rs:31:15
--> $DIR/macro-at-most-once-rep.rs:33:15
|
LL | macro_rules! barplus {
| -------------------- when calling this macro
Expand All @@ -77,13 +77,13 @@ LL | barplus!(a?);
| ^ no rules expected this token in macro call
|
note: while trying to match `+`
--> $DIR/macro-at-most-once-rep-2018.rs:15:11
--> $DIR/macro-at-most-once-rep.rs:17:11
|
LL | ($(a)?+) => {}; // ok. matches "a+" and "+"
| ^

error: no rules expected `?`
--> $DIR/macro-at-most-once-rep-2018.rs:32:15
--> $DIR/macro-at-most-once-rep.rs:34:15
|
LL | macro_rules! barplus {
| -------------------- when calling this macro
Expand All @@ -92,13 +92,13 @@ LL | barplus!(a?a);
| ^ no rules expected this token in macro call
|
note: while trying to match `+`
--> $DIR/macro-at-most-once-rep-2018.rs:15:11
--> $DIR/macro-at-most-once-rep.rs:17:11
|
LL | ($(a)?+) => {}; // ok. matches "a+" and "+"
| ^

error: unexpected end of macro invocation
--> $DIR/macro-at-most-once-rep-2018.rs:36:5
--> $DIR/macro-at-most-once-rep.rs:38:5
|
LL | macro_rules! barstar {
| -------------------- when calling this macro
Expand All @@ -107,13 +107,13 @@ LL | barstar!();
| ^^^^^^^^^^ missing tokens in macro arguments
|
note: while trying to match `*`
--> $DIR/macro-at-most-once-rep-2018.rs:19:11
--> $DIR/macro-at-most-once-rep.rs:21:11
|
LL | ($(a)?*) => {}; // ok. matches "a*" and "*"
| ^

error: unexpected end of macro invocation
--> $DIR/macro-at-most-once-rep-2018.rs:37:15
--> $DIR/macro-at-most-once-rep.rs:39:15
|
LL | macro_rules! barstar {
| -------------------- when calling this macro
Expand All @@ -122,13 +122,13 @@ LL | barstar!(a);
| ^ missing tokens in macro arguments
|
note: while trying to match `*`
--> $DIR/macro-at-most-once-rep-2018.rs:19:11
--> $DIR/macro-at-most-once-rep.rs:21:11
|
LL | ($(a)?*) => {}; // ok. matches "a*" and "*"
| ^

error: no rules expected `?`
--> $DIR/macro-at-most-once-rep-2018.rs:38:15
--> $DIR/macro-at-most-once-rep.rs:40:15
|
LL | macro_rules! barstar {
| -------------------- when calling this macro
Expand All @@ -137,13 +137,13 @@ LL | barstar!(a?);
| ^ no rules expected this token in macro call
|
note: while trying to match `*`
--> $DIR/macro-at-most-once-rep-2018.rs:19:11
--> $DIR/macro-at-most-once-rep.rs:21:11
|
LL | ($(a)?*) => {}; // ok. matches "a*" and "*"
| ^

error: no rules expected `?`
--> $DIR/macro-at-most-once-rep-2018.rs:39:15
--> $DIR/macro-at-most-once-rep.rs:41:15
|
LL | macro_rules! barstar {
| -------------------- when calling this macro
Expand All @@ -152,7 +152,7 @@ LL | barstar!(a?a);
| ^ no rules expected this token in macro call
|
note: while trying to match `*`
--> $DIR/macro-at-most-once-rep-2018.rs:19:11
--> $DIR/macro-at-most-once-rep.rs:21:11
|
LL | ($(a)?*) => {}; // ok. matches "a*" and "*"
| ^
Expand Down
Loading
Loading