We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eba3228 commit 1a7591dCopy full SHA for 1a7591d
compiler/rustc_expand/src/proc_macro.rs
@@ -133,8 +133,11 @@ impl MultiItemModifier for ProcMacroDerive {
133
}
134
135
136
- // fail if there have been errors emitted
137
- if ecx.sess.parse_sess.span_diagnostic.err_count() > error_count_before {
+ // fail if there have been errors emitted,
+ // or if there's any unparsed tokens left.
138
+ if parser.token != token::Eof
139
+ || ecx.sess.parse_sess.span_diagnostic.err_count() > error_count_before
140
+ {
141
ecx.struct_span_err(span, "proc-macro derive produced unparseable tokens").emit();
142
143
0 commit comments