From 6954f9d4f21837e145b4aa629262a62b5f21fa8f Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Tue, 27 Jul 2021 17:50:18 -0500 Subject: [PATCH] Update stderr --- src/test/ui/macros/macro-in-expression-context.fixed | 4 ++++ src/test/ui/macros/macro-in-expression-context.rs | 4 ++++ src/test/ui/macros/macro-in-expression-context.stderr | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/test/ui/macros/macro-in-expression-context.fixed b/src/test/ui/macros/macro-in-expression-context.fixed index 3fb4e0dbfa6..f22caf2793f 100644 --- a/src/test/ui/macros/macro-in-expression-context.fixed +++ b/src/test/ui/macros/macro-in-expression-context.fixed @@ -5,6 +5,8 @@ macro_rules! foo { assert_eq!("A", "A"); //~^ WARN trailing semicolon in macro //~| WARN this was previously + //~| NOTE macro invocations at the end of a block + //~| NOTE to ignore the value produced by the macro //~| NOTE for more information //~| NOTE `#[warn(semicolon_in_expressions_from_macros)]` on by default assert_eq!("B", "B"); @@ -20,4 +22,6 @@ fn main() { //~| NOTE in this expansion //~| NOTE in this expansion //~| NOTE in this expansion + //~| NOTE in this expansion + //~| NOTE in this expansion } diff --git a/src/test/ui/macros/macro-in-expression-context.rs b/src/test/ui/macros/macro-in-expression-context.rs index fc434071dcd..1a056e582ff 100644 --- a/src/test/ui/macros/macro-in-expression-context.rs +++ b/src/test/ui/macros/macro-in-expression-context.rs @@ -5,6 +5,8 @@ macro_rules! foo { assert_eq!("A", "A"); //~^ WARN trailing semicolon in macro //~| WARN this was previously + //~| NOTE macro invocations at the end of a block + //~| NOTE to ignore the value produced by the macro //~| NOTE for more information //~| NOTE `#[warn(semicolon_in_expressions_from_macros)]` on by default assert_eq!("B", "B"); @@ -20,4 +22,6 @@ fn main() { //~| NOTE in this expansion //~| NOTE in this expansion //~| NOTE in this expansion + //~| NOTE in this expansion + //~| NOTE in this expansion } diff --git a/src/test/ui/macros/macro-in-expression-context.stderr b/src/test/ui/macros/macro-in-expression-context.stderr index ddc1709a270..1840babd61d 100644 --- a/src/test/ui/macros/macro-in-expression-context.stderr +++ b/src/test/ui/macros/macro-in-expression-context.stderr @@ -1,5 +1,5 @@ error: macro expansion ignores token `assert_eq` and any following - --> $DIR/macro-in-expression-context.rs:10:9 + --> $DIR/macro-in-expression-context.rs:12:9 | LL | assert_eq!("B", "B"); | ^^^^^^^^^ @@ -23,6 +23,8 @@ LL | foo!() = note: `#[warn(semicolon_in_expressions_from_macros)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #79813 + = note: macro invocations at the end of a block are treated as expressions + = note: to ignore the value produced by the macro, add a semicolon after the invocation of `foo` = note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error; 1 warning emitted