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
err.note("captured metavariables except for `:tt`, `:ident` and `:lifetime` cannot be compared to other tokens");
70
-
err.note("see https://doc.rust-lang.org/nightly/reference/macros-by-example.html#forwarding-a-matched-fragment for more information");
71
-
err.help("try using `:tt` instead in the macro definition");
70
+
err.note("see <https://doc.rust-lang.org/nightly/reference/macros-by-example.html#forwarding-a-matched-fragment> for more information");
71
+
72
+
if !def_span.is_dummy() && !cx.source_map().is_imported(def_span){
73
+
err.help("try using `:tt` instead in the macro definition");
74
+
}
72
75
}
73
76
74
77
// Check whether there's a missing comma in this macro call, like `println!("{}" a);`
Copy file name to clipboardExpand all lines: tests/ui/macros/nonterminal-matching.stderr
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ LL | macro n(a $nt_item b) {
19
19
LL | complex_nonterminal!(enum E {});
20
20
| ------------------------------- in this macro invocation
21
21
= note: captured metavariables except for `:tt`, `:ident` and `:lifetime` cannot be compared to other tokens
22
-
= note: see https://doc.rust-lang.org/nightly/reference/macros-by-example.html#forwarding-a-matched-fragment for more information
22
+
= note: see <https://doc.rust-lang.org/nightly/reference/macros-by-example.html#forwarding-a-matched-fragment> for more information
23
23
= help: try using `:tt` instead in the macro definition
24
24
= note: this error originates in the macro `complex_nonterminal` (in Nightly builds, run with -Z macro-backtrace for more info)
0 commit comments