From 018c4950b9406055dec02ef0fb52f132e2bb1e2c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 19 Jun 2024 11:25:56 +0200 Subject: Merging upstream version 1.76.0+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/parser/macro/bad-macro-argument.stderr | 2 +- tests/ui/parser/macro/issue-37113.stderr | 2 +- tests/ui/parser/macro/issue-37234.stderr | 2 +- tests/ui/parser/macro/macro-doc-comments-1.stderr | 2 +- tests/ui/parser/macro/macro-doc-comments-2.stderr | 2 +- tests/ui/parser/macro/macro-expand-to-match-arm.rs | 8 +++++--- tests/ui/parser/macro/macro-expand-to-match-arm.stderr | 18 ++++++++++++++---- 7 files changed, 24 insertions(+), 12 deletions(-) (limited to 'tests/ui/parser/macro') 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 = `, `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 -- cgit v1.2.3