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-7
Original file line number
Diff line number
Diff line change
@@ -50,12 +50,9 @@ 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 `A { a: a, b: 0, c: _, .. }`
53
+
error: expected expression, found pattern `A { a: a, b: 0, c: _, .. }`
54
54
--> $DIR/trace_faulty_macros.rs:16:9
55
55
|
56
-
LL | pat_macro!(A{a:a, b:0, c:_, ..});
57
-
| -------------------- this is interpreted as pattern `A { a: a, b: 0, c: _, .. }`
58
-
...
59
56
LL | $a
60
57
| ^^ expected expression
61
58
...
@@ -72,21 +69,22 @@ LL | #[derive(Debug)]
72
69
LL | fn use_derive_macro_as_attr() {}
73
70
| -------------------------------- not a `struct`, `enum` or `union`
74
71
75
-
error: expected expression, found `1 + 1`
72
+
error: expected expression, found pattern `1 + 1`
76
73
--> $DIR/trace_faulty_macros.rs:49:37
77
74
|
78
75
LL | (let $p:pat = $e:expr) => {test!(($p,$e))};
79
-
| -- this is interpreted as pattern `1 + 1` (in expansion #2)
76
+
| -- this is interpreted as pattern, but it was previously interpreted as expression
80
77
...
81
78
LL | (($p:pat, $e:pat)) => {let $p = $e;};
82
79
| ^^ expected expression
83
80
...
84
81
LL | test!(let x = 1+1);
85
82
| ------------------
86
83
| | |
87
-
| | this is interpreted as expression `1 + 1` (in expansion #1)
84
+
| | this is interpreted as expression
88
85
| in this macro invocation
89
86
|
87
+
= 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
90
88
= note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
0 commit comments