summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/macro
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:25:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:25:56 +0000
commit018c4950b9406055dec02ef0fb52f132e2bb1e2c (patch)
treea835ebdf2088ef88fa681f8fad45f09922c1ae9a /tests/ui/parser/macro
parentAdding debian version 1.75.0+dfsg1-5. (diff)
downloadrustc-018c4950b9406055dec02ef0fb52f132e2bb1e2c.tar.xz
rustc-018c4950b9406055dec02ef0fb52f132e2bb1e2c.zip
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/parser/macro')
-rw-r--r--tests/ui/parser/macro/bad-macro-argument.stderr2
-rw-r--r--tests/ui/parser/macro/issue-37113.stderr2
-rw-r--r--tests/ui/parser/macro/issue-37234.stderr2
-rw-r--r--tests/ui/parser/macro/macro-doc-comments-1.stderr2
-rw-r--r--tests/ui/parser/macro/macro-doc-comments-2.stderr2
-rw-r--r--tests/ui/parser/macro/macro-expand-to-match-arm.rs8
-rw-r--r--tests/ui/parser/macro/macro-expand-to-match-arm.stderr18
7 files changed, 24 insertions, 12 deletions
diff --git a/tests/ui/parser/macro/bad-macro-argument.stderr b/tests/ui/parser/macro/bad-macro-argument.stderr
index 3cd8accb6..ba6499d71 100644
--- a/tests/ui/parser/macro/bad-macro-argument.stderr
+++ b/tests/ui/parser/macro/bad-macro-argument.stderr
@@ -4,5 +4,5 @@ error: expected expression, found end of macro arguments
LL | println!("Hello, {}", message/);
| ^ expected expression
-error: aborting due to previous error
+error: aborting due to 1 previous error
diff --git a/tests/ui/parser/macro/issue-37113.stderr b/tests/ui/parser/macro/issue-37113.stderr
index da9e743a0..1f2fe2310 100644
--- a/tests/ui/parser/macro/issue-37113.stderr
+++ b/tests/ui/parser/macro/issue-37113.stderr
@@ -12,5 +12,5 @@ LL | test_macro!(String,);
= help: enum variants can be `Variant`, `Variant = <integer>`, `Variant(Type, ..., TypeN)` or `Variant { fields: Types }`
= note: this error originates in the macro `test_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: aborting due to previous error
+error: aborting due to 1 previous error
diff --git a/tests/ui/parser/macro/issue-37234.stderr b/tests/ui/parser/macro/issue-37234.stderr
index d79196204..cd91ea441 100644
--- a/tests/ui/parser/macro/issue-37234.stderr
+++ b/tests/ui/parser/macro/issue-37234.stderr
@@ -9,5 +9,5 @@ LL | failed!();
|
= note: this error originates in the macro `failed` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: aborting due to previous error
+error: aborting due to 1 previous error
diff --git a/tests/ui/parser/macro/macro-doc-comments-1.stderr b/tests/ui/parser/macro/macro-doc-comments-1.stderr
index eaeb62d2c..9d2d1bc00 100644
--- a/tests/ui/parser/macro/macro-doc-comments-1.stderr
+++ b/tests/ui/parser/macro/macro-doc-comments-1.stderr
@@ -16,5 +16,5 @@ note: while trying to match `[`
LL | (#[$outer:meta]) => ()
| ^
-error: aborting due to previous error
+error: aborting due to 1 previous error
diff --git a/tests/ui/parser/macro/macro-doc-comments-2.stderr b/tests/ui/parser/macro/macro-doc-comments-2.stderr
index 1dcd95f6f..22efd995b 100644
--- a/tests/ui/parser/macro/macro-doc-comments-2.stderr
+++ b/tests/ui/parser/macro/macro-doc-comments-2.stderr
@@ -16,5 +16,5 @@ note: while trying to match `!`
LL | (#![$inner:meta]) => ()
| ^
-error: aborting due to previous error
+error: aborting due to 1 previous error
diff --git a/tests/ui/parser/macro/macro-expand-to-match-arm.rs b/tests/ui/parser/macro/macro-expand-to-match-arm.rs
index 39d1d065e..db38fa0d7 100644
--- a/tests/ui/parser/macro/macro-expand-to-match-arm.rs
+++ b/tests/ui/parser/macro/macro-expand-to-match-arm.rs
@@ -1,6 +1,9 @@
macro_rules! arm {
($pattern:pat => $block:block) => {
$pattern => $block
+ //~^ ERROR macro expansion ignores token `=>` and any following
+ //~| NOTE the usage of `arm!` is likely invalid in pattern context
+ //~| NOTE macros cannot expand to match arms
};
}
@@ -9,9 +12,8 @@ fn main() {
match x {
Some(1) => {},
arm!(None => {}),
- //~^ NOTE macros cannot expand to match arms
- //~| ERROR unexpected `,` in pattern
- // doesn't recover
+ //~^ NOTE caused by the macro expansion here
+ //~| ERROR `match` arm with no body
Some(2) => {},
_ => {},
};
diff --git a/tests/ui/parser/macro/macro-expand-to-match-arm.stderr b/tests/ui/parser/macro/macro-expand-to-match-arm.stderr
index 1a5f46968..e3e7ff89c 100644
--- a/tests/ui/parser/macro/macro-expand-to-match-arm.stderr
+++ b/tests/ui/parser/macro/macro-expand-to-match-arm.stderr
@@ -1,10 +1,20 @@
-error: unexpected `,` in pattern
- --> $DIR/macro-expand-to-match-arm.rs:11:25
+error: macro expansion ignores token `=>` and any following
+ --> $DIR/macro-expand-to-match-arm.rs:3:18
|
+LL | $pattern => $block
+ | ^^
+...
LL | arm!(None => {}),
- | ^
+ | ---------------- caused by the macro expansion here
|
+ = note: the usage of `arm!` is likely invalid in pattern context
= note: macros cannot expand to match arms
-error: aborting due to previous error
+error: `match` arm with no body
+ --> $DIR/macro-expand-to-match-arm.rs:14:9
+ |
+LL | arm!(None => {}),
+ | ^^^^^^^^^^^^^^^^- help: add a body after the pattern: `=> todo!(),`
+
+error: aborting due to 2 previous errors