about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2021-07-27 17:50:18 -0500
committerAaron Hill <aa1ronham@gmail.com>2021-07-27 18:21:25 -0500
commit6954f9d4f21837e145b4aa629262a62b5f21fa8f (patch)
treeef52c36d7507fe1f4e7af5357fcda5c9a32d31cd
parentcf167c9c9c0576472b67f5498a074bc697c9af23 (diff)
downloadrust-6954f9d4f21837e145b4aa629262a62b5f21fa8f.tar.gz
rust-6954f9d4f21837e145b4aa629262a62b5f21fa8f.zip
Update stderr
-rw-r--r--src/test/ui/macros/macro-in-expression-context.fixed4
-rw-r--r--src/test/ui/macros/macro-in-expression-context.rs4
-rw-r--r--src/test/ui/macros/macro-in-expression-context.stderr4
3 files changed, 11 insertions, 1 deletions
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 <https://github.com/rust-lang/rust/issues/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