Skip to content

Commit 9c8d0e3

Browse files
committed
Provide an actual error when expanding macros to foreign items
1 parent 13aa188 commit 9c8d0e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libsyntax/parse/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4492,9 +4492,9 @@ impl Parser {
44924492
self.span_err(view_item.span,
44934493
"`use` and `extern mod` declarations must precede items");
44944494
}
4495-
iovi_item(_) => {
4495+
iovi_item(item) => {
44964496
// FIXME #5668: this will occur for a macro invocation:
4497-
fail!();
4497+
self.span_fatal(item.span, "macros cannot expand to foreign items");
44984498
}
44994499
iovi_foreign_item(foreign_item) => {
45004500
foreign_items.push(foreign_item);

0 commit comments

Comments
 (0)