You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/ui/macros/trace_faulty_macros.stderr
+5-16
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ LL | my_recursive_macro!();
50
50
= note: expanding `my_recursive_macro! { }`
51
51
= note: to `my_recursive_macro! ();`
52
52
53
-
error: expected expression, found pattern `A { a: a, b: 0, c: _, .. }`
53
+
error: expected expression, found `pat` metavariable
54
54
--> $DIR/trace_faulty_macros.rs:16:9
55
55
|
56
56
LL | $a
@@ -69,26 +69,15 @@ LL | #[derive(Debug)]
69
69
LL | fn use_derive_macro_as_attr() {}
70
70
| -------------------------------- not a `struct`, `enum` or `union`
71
71
72
-
error: expected expression, found pattern `1 + 1`
72
+
error: expected expression, found `pat` metavariable
73
73
--> $DIR/trace_faulty_macros.rs:49:37
74
74
|
75
-
LL | (let $p:pat = $e:expr) => {test!(($p,$e))};
76
-
| ------- -- this is interpreted as expression, but it is expected to be pattern
77
-
| |
78
-
| this macro fragment matcher is expression
79
-
...
80
75
LL | (($p:pat, $e:pat)) => {let $p = $e;};
81
-
| ------ ^^ expected expression
82
-
| |
83
-
| this macro fragment matcher is pattern
76
+
| ^^ expected expression
84
77
...
85
78
LL | test!(let x = 1+1);
86
-
| ------------------
87
-
| | |
88
-
| | this is expected to be expression
89
-
| in this macro invocation
79
+
| ------------------ in this macro invocation
90
80
|
91
-
= 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
92
81
= note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
93
82
94
83
note: trace_macro
@@ -100,7 +89,7 @@ LL | let a = pat_macro!();
100
89
= note: expanding `pat_macro! { }`
101
90
= note: to `pat_macro! (A { a : a, b : 0, c : _, .. });`
102
91
= note: expanding `pat_macro! { A { a : a, b : 0, c : _, .. } }`
0 commit comments