summaryrefslogtreecommitdiffstats
path: root/tests/ui/macros/trace_faulty_macros.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
commit9918693037dce8aa4bb6f08741b6812923486c18 (patch)
tree21d2b40bec7e6a7ea664acee056eb3d08e15a1cf /tests/ui/macros/trace_faulty_macros.stderr
parentReleasing progress-linux version 1.75.0+dfsg1-5~progress7.99u1. (diff)
downloadrustc-9918693037dce8aa4bb6f08741b6812923486c18.tar.xz
rustc-9918693037dce8aa4bb6f08741b6812923486c18.zip
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/macros/trace_faulty_macros.stderr')
-rw-r--r--tests/ui/macros/trace_faulty_macros.stderr49
1 files changed, 41 insertions, 8 deletions
diff --git a/tests/ui/macros/trace_faulty_macros.stderr b/tests/ui/macros/trace_faulty_macros.stderr
index 21e47da07..81047c7a2 100644
--- a/tests/ui/macros/trace_faulty_macros.stderr
+++ b/tests/ui/macros/trace_faulty_macros.stderr
@@ -20,7 +20,7 @@ LL | my_faulty_macro!();
| ^^^^^^^^^^^^^^^^^^
|
= note: expanding `my_faulty_macro! { }`
- = note: to `my_faulty_macro! (bcd) ;`
+ = note: to `my_faulty_macro! (bcd);`
= note: expanding `my_faulty_macro! { bcd }`
error: recursion limit reached while expanding `my_recursive_macro!`
@@ -42,15 +42,15 @@ LL | my_recursive_macro!();
| ^^^^^^^^^^^^^^^^^^^^^
|
= note: expanding `my_recursive_macro! { }`
- = note: to `my_recursive_macro! () ;`
+ = note: to `my_recursive_macro! ();`
= note: expanding `my_recursive_macro! { }`
- = note: to `my_recursive_macro! () ;`
+ = note: to `my_recursive_macro! ();`
= note: expanding `my_recursive_macro! { }`
- = note: to `my_recursive_macro! () ;`
+ = note: to `my_recursive_macro! ();`
= note: expanding `my_recursive_macro! { }`
- = note: to `my_recursive_macro! () ;`
+ = note: to `my_recursive_macro! ();`
-error: expected expression, found `A { a: a, b: 0, c: _, .. }`
+error: expected expression, found pattern `A { a: a, b: 0, c: _, .. }`
--> $DIR/trace_faulty_macros.rs:16:9
|
LL | $a
@@ -69,6 +69,28 @@ LL | #[derive(Debug)]
LL | fn use_derive_macro_as_attr() {}
| -------------------------------- not a `struct`, `enum` or `union`
+error: expected expression, found pattern `1 + 1`
+ --> $DIR/trace_faulty_macros.rs:49:37
+ |
+LL | (let $p:pat = $e:expr) => {test!(($p,$e))};
+ | ------- -- this is interpreted as expression, but it is expected to be pattern
+ | |
+ | this macro fragment matcher is expression
+...
+LL | (($p:pat, $e:pat)) => {let $p = $e;};
+ | ------ ^^ expected expression
+ | |
+ | this macro fragment matcher is pattern
+...
+LL | test!(let x = 1+1);
+ | ------------------
+ | | |
+ | | this is expected to be expression
+ | in this macro invocation
+ |
+ = note: when forwarding a matched fragment to another macro-by-example, matchers in the second macro will see an opaque AST of the fragment type, not the underlying tokens
+ = note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
+
note: trace_macro
--> $DIR/trace_faulty_macros.rs:36:13
|
@@ -76,10 +98,21 @@ LL | let a = pat_macro!();
| ^^^^^^^^^^^^
|
= note: expanding `pat_macro! { }`
- = note: to `pat_macro! (A { a : a, b : 0, c : _, .. }) ;`
+ = note: to `pat_macro! (A { a : a, b : 0, c : _, .. });`
= note: expanding `pat_macro! { A { a : a, b : 0, c : _, .. } }`
= note: to `A { a: a, b: 0, c: _, .. }`
-error: aborting due to 4 previous errors
+note: trace_macro
+ --> $DIR/trace_faulty_macros.rs:53:5
+ |
+LL | test!(let x = 1+1);
+ | ^^^^^^^^^^^^^^^^^^
+ |
+ = note: expanding `test! { let x = 1+1 }`
+ = note: to `test! ((x, 1 + 1))`
+ = note: expanding `test! { (x, 1 + 1) }`
+ = note: to `let x = 1 + 1 ;`
+
+error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0774`.