about summary refs log tree commit diff
path: root/src/test/ui/parser
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2021-02-13 14:52:25 -0500
committerAaron Hill <aa1ronham@gmail.com>2021-05-12 19:03:06 -0400
commit0dd9f118d973bb077c6ff0e2a57421ca2eecb81c (patch)
tree02a54f3e5aceaf032fbc32486fd122f47dd40553 /src/test/ui/parser
parent70e52caed91a43fc01867921e67fcd3478056edd (diff)
downloadrust-0dd9f118d973bb077c6ff0e2a57421ca2eecb81c.tar.gz
rust-0dd9f118d973bb077c6ff0e2a57421ca2eecb81c.zip
Show macro name in 'this error originates in macro' message
When there are multiple macros in use, it can be difficult to tell
which one was responsible for producing an error.
Diffstat (limited to 'src/test/ui/parser')
-rw-r--r--src/test/ui/parser/bad-interpolated-block.stderr6
-rw-r--r--src/test/ui/parser/float-field-interpolated.stderr8
-rw-r--r--src/test/ui/parser/issue-48137-macros-cannot-interpolate-impl-items-bad-variants.stderr6
-rw-r--r--src/test/ui/parser/issue-65122-mac-invoc-in-mut-patterns.stderr6
-rw-r--r--src/test/ui/parser/issue-73568-lifetime-after-mut.stderr2
-rw-r--r--src/test/ui/parser/labeled-no-colon-expr.stderr2
-rw-r--r--src/test/ui/parser/macro/issue-37113.stderr2
-rw-r--r--src/test/ui/parser/macro/issue-37234.stderr2
-rw-r--r--src/test/ui/parser/macro/macro-incomplete-parse.stderr2
-rw-r--r--src/test/ui/parser/macro/pub-item-macro.stderr4
-rw-r--r--src/test/ui/parser/missing-closing-angle-bracket-eq-constraint.stderr4
-rw-r--r--src/test/ui/parser/missing-semicolon.stderr2
-rw-r--r--src/test/ui/parser/mut-patterns.stderr2
-rw-r--r--src/test/ui/parser/recover-range-pats.stderr8
14 files changed, 28 insertions, 28 deletions
diff --git a/src/test/ui/parser/bad-interpolated-block.stderr b/src/test/ui/parser/bad-interpolated-block.stderr
index 2cbb6a13e74..9a6957a0408 100644
--- a/src/test/ui/parser/bad-interpolated-block.stderr
+++ b/src/test/ui/parser/bad-interpolated-block.stderr
@@ -9,7 +9,7 @@ LL |         'lab: $b;
 LL |     m!({});
    |     ------- in this macro invocation
    |
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: cannot use a `block` macro fragment here
   --> $DIR/bad-interpolated-block.rs:8:16
@@ -22,7 +22,7 @@ LL |         unsafe $b;
 LL |     m!({});
    |     ------- in this macro invocation
    |
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: cannot use a `block` macro fragment here
   --> $DIR/bad-interpolated-block.rs:9:23
@@ -33,7 +33,7 @@ LL |         |x: u8| -> () $b;
 LL |     m!({});
    |     ------- in this macro invocation
    |
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to 3 previous errors
 
diff --git a/src/test/ui/parser/float-field-interpolated.stderr b/src/test/ui/parser/float-field-interpolated.stderr
index fb974f085cb..4b03427cd58 100644
--- a/src/test/ui/parser/float-field-interpolated.stderr
+++ b/src/test/ui/parser/float-field-interpolated.stderr
@@ -7,7 +7,7 @@ LL |         { s.$b; }
 LL |     generate_field_accesses!(1.1, 1.1, 1.1);
    |     ---------------------------------------- in this macro invocation
    |
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `generate_field_accesses` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: expected one of `.`, `;`, `?`, `}`, or an operator, found `1.1`
   --> $DIR/float-field-interpolated.rs:8:13
@@ -18,7 +18,7 @@ LL |         { s.$b; }
 LL |     generate_field_accesses!(1.1, 1.1, 1.1);
    |     ---------------------------------------- in this macro invocation
    |
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `generate_field_accesses` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: unexpected token: `1.1`
   --> $DIR/float-field-interpolated.rs:10:13
@@ -29,7 +29,7 @@ LL |         { s.$c; }
 LL |     generate_field_accesses!(1.1, 1.1, 1.1);
    |     ---------------------------------------- in this macro invocation
    |
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `generate_field_accesses` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: expected one of `.`, `;`, `?`, `}`, or an operator, found `1.1`
   --> $DIR/float-field-interpolated.rs:10:13
@@ -40,7 +40,7 @@ LL |         { s.$c; }
 LL |     generate_field_accesses!(1.1, 1.1, 1.1);
    |     ---------------------------------------- in this macro invocation
    |
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `generate_field_accesses` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to 4 previous errors
 
diff --git a/src/test/ui/parser/issue-48137-macros-cannot-interpolate-impl-items-bad-variants.stderr b/src/test/ui/parser/issue-48137-macros-cannot-interpolate-impl-items-bad-variants.stderr
index c83205aadd6..0ab718d8bd4 100644
--- a/src/test/ui/parser/issue-48137-macros-cannot-interpolate-impl-items-bad-variants.stderr
+++ b/src/test/ui/parser/issue-48137-macros-cannot-interpolate-impl-items-bad-variants.stderr
@@ -16,7 +16,7 @@ LL |     expand_to_enum!();
    |     ------------------ in this macro invocation
    |
    = help: consider moving the enum out to a nearby module scope
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `expand_to_enum` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: struct is not supported in `trait`s or `impl`s
   --> $DIR/issue-48137-macros-cannot-interpolate-impl-items-bad-variants.rs:31:5
@@ -36,7 +36,7 @@ LL |     expand_to_enum!();
    |     ------------------ in this macro invocation
    |
    = help: consider moving the enum out to a nearby module scope
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `expand_to_enum` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: struct is not supported in `extern` blocks
   --> $DIR/issue-48137-macros-cannot-interpolate-impl-items-bad-variants.rs:42:5
@@ -56,7 +56,7 @@ LL |     expand_to_enum!();
    |     ------------------ in this macro invocation
    |
    = help: consider moving the enum out to a nearby module scope
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `expand_to_enum` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to 6 previous errors
 
diff --git a/src/test/ui/parser/issue-65122-mac-invoc-in-mut-patterns.stderr b/src/test/ui/parser/issue-65122-mac-invoc-in-mut-patterns.stderr
index 16a08b9b856..8c032e588e3 100644
--- a/src/test/ui/parser/issue-65122-mac-invoc-in-mut-patterns.stderr
+++ b/src/test/ui/parser/issue-65122-mac-invoc-in-mut-patterns.stderr
@@ -8,7 +8,7 @@ LL |     mac1! { does_not_exist!() }
    |     --------------------------- in this macro invocation
    |
    = note: `mut` may be followed by `variable` and `variable @ pattern`
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `mac1` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: expected identifier, found `does_not_exist!()`
   --> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:13:17
@@ -19,7 +19,7 @@ LL |         let mut $eval = ();
 LL |     mac2! { does_not_exist!() }
    |     --------------------------- in this macro invocation
    |
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: `mut` must be followed by a named binding
   --> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:13:13
@@ -31,7 +31,7 @@ LL |     mac2! { does_not_exist!() }
    |     --------------------------- in this macro invocation
    |
    = note: `mut` may be followed by `variable` and `variable @ pattern`
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: cannot find macro `does_not_exist` in this scope
   --> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:22:13
diff --git a/src/test/ui/parser/issue-73568-lifetime-after-mut.stderr b/src/test/ui/parser/issue-73568-lifetime-after-mut.stderr
index 9b05383dd7d..f83b7944b1b 100644
--- a/src/test/ui/parser/issue-73568-lifetime-after-mut.stderr
+++ b/src/test/ui/parser/issue-73568-lifetime-after-mut.stderr
@@ -19,7 +19,7 @@ LL |         fn w<$lt>(w: &mut $lt i32) {}
 LL | mac!('a);
    | --------- in this macro invocation
    |
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0423]: expected value, found trait `Send`
   --> $DIR/issue-73568-lifetime-after-mut.rs:19:28
diff --git a/src/test/ui/parser/labeled-no-colon-expr.stderr b/src/test/ui/parser/labeled-no-colon-expr.stderr
index 4f5e8f78aa0..50995895bc8 100644
--- a/src/test/ui/parser/labeled-no-colon-expr.stderr
+++ b/src/test/ui/parser/labeled-no-colon-expr.stderr
@@ -70,7 +70,7 @@ LL |             'l5 $b;
 LL |     m!({});
    |     ------- in this macro invocation
    |
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: labeled expression must be followed by `:`
   --> $DIR/labeled-no-colon-expr.rs:16:8
diff --git a/src/test/ui/parser/macro/issue-37113.stderr b/src/test/ui/parser/macro/issue-37113.stderr
index 20ee9d35ec7..f9f53e65d7b 100644
--- a/src/test/ui/parser/macro/issue-37113.stderr
+++ b/src/test/ui/parser/macro/issue-37113.stderr
@@ -7,7 +7,7 @@ LL |             $( $t, )*
 LL |     test_macro!(String,);
    |     --------------------- in this macro invocation
    |
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = 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
 
diff --git a/src/test/ui/parser/macro/issue-37234.stderr b/src/test/ui/parser/macro/issue-37234.stderr
index 2db0f848f75..f0ec79e5357 100644
--- a/src/test/ui/parser/macro/issue-37234.stderr
+++ b/src/test/ui/parser/macro/issue-37234.stderr
@@ -7,7 +7,7 @@ LL |         let x = 5 "";
 LL |     failed!();
    |     ---------- in this macro invocation
    |
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = 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
 
diff --git a/src/test/ui/parser/macro/macro-incomplete-parse.stderr b/src/test/ui/parser/macro/macro-incomplete-parse.stderr
index c9d220b1a27..186b22dce9a 100644
--- a/src/test/ui/parser/macro/macro-incomplete-parse.stderr
+++ b/src/test/ui/parser/macro/macro-incomplete-parse.stderr
@@ -18,7 +18,7 @@ LL |     () => ( 1,
 LL |     ignored_expr!();
    |     ---------------- in this macro invocation
    |
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `ignored_expr` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: macro expansion ignores token `,` and any following
   --> $DIR/macro-incomplete-parse.rs:16:14
diff --git a/src/test/ui/parser/macro/pub-item-macro.stderr b/src/test/ui/parser/macro/pub-item-macro.stderr
index 1c5613ac986..0b81d2074b6 100644
--- a/src/test/ui/parser/macro/pub-item-macro.stderr
+++ b/src/test/ui/parser/macro/pub-item-macro.stderr
@@ -8,7 +8,7 @@ LL |     pub_x!();
    |     --------- in this macro invocation
    |
    = help: try adjusting the macro to put `pub` inside the invocation
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `pub_x` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0603]: static `x` is private
   --> $DIR/pub-item-macro.rs:20:23
@@ -24,7 +24,7 @@ LL |         static x: u32 = 0;
 ...
 LL |     pub_x!();
    |     --------- in this macro invocation
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `priv_x` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/parser/missing-closing-angle-bracket-eq-constraint.stderr b/src/test/ui/parser/missing-closing-angle-bracket-eq-constraint.stderr
index ae53334f5e0..93403372bcb 100644
--- a/src/test/ui/parser/missing-closing-angle-bracket-eq-constraint.stderr
+++ b/src/test/ui/parser/missing-closing-angle-bracket-eq-constraint.stderr
@@ -32,7 +32,7 @@ LL |   let v : Vec<(u32,_) = vec![];
    |       |
    |       consider giving `v` the explicit type `Vec<T>`, where the type parameter `T` is specified
    |
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0282]: type annotations needed for `Vec<T>`
   --> $DIR/missing-closing-angle-bracket-eq-constraint.rs:18:20
@@ -42,7 +42,7 @@ LL |   let v : Vec<'a = vec![];
    |       |
    |       consider giving `v` the explicit type `Vec<T>`, where the type parameter `T` is specified
    |
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to 5 previous errors
 
diff --git a/src/test/ui/parser/missing-semicolon.stderr b/src/test/ui/parser/missing-semicolon.stderr
index 26cb3d13d9c..68f0f440c46 100644
--- a/src/test/ui/parser/missing-semicolon.stderr
+++ b/src/test/ui/parser/missing-semicolon.stderr
@@ -7,7 +7,7 @@ LL |         $( let x = $e1 )*;
 LL | fn main() { m!(0, 0; 0, 0); }
    |             --------------- in this macro invocation
    |
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/parser/mut-patterns.stderr b/src/test/ui/parser/mut-patterns.stderr
index 9a6af7394bf..88a77adcd31 100644
--- a/src/test/ui/parser/mut-patterns.stderr
+++ b/src/test/ui/parser/mut-patterns.stderr
@@ -108,7 +108,7 @@ LL |             let mut $p = 0;
 LL |     foo!(x);
    |     -------- in this macro invocation
    |
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to 13 previous errors
 
diff --git a/src/test/ui/parser/recover-range-pats.stderr b/src/test/ui/parser/recover-range-pats.stderr
index 45f6b111e25..3236ef0db28 100644
--- a/src/test/ui/parser/recover-range-pats.stderr
+++ b/src/test/ui/parser/recover-range-pats.stderr
@@ -167,7 +167,7 @@ LL |             let ...$e;
 LL |     mac!(0);
    |     -------- in this macro invocation
    |
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0586]: inclusive range with no end
   --> $DIR/recover-range-pats.rs:154:19
@@ -179,7 +179,7 @@ LL |     mac!(0);
    |     -------- in this macro invocation
    |
    = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0586]: inclusive range with no end
   --> $DIR/recover-range-pats.rs:155:19
@@ -191,7 +191,7 @@ LL |     mac!(0);
    |     -------- in this macro invocation
    |
    = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: `...` range patterns are deprecated
   --> $DIR/recover-range-pats.rs:42:13
@@ -281,7 +281,7 @@ LL |     mac2!(0, 1);
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
    = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0029]: only `char` and numeric types are allowed in range patterns
   --> $DIR/recover-range-pats.rs:20:12