From 9c8d0e375e36e091e87dbd2bdf6022562bdb41c4 Mon Sep 17 00:00:00 2001 From: James Miller Date: Fri, 7 Jun 2013 11:28:38 +1200 Subject: [PATCH] Provide an actual error when expanding macros to foreign items --- src/libsyntax/parse/parser.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index f013dfaceba..552d4b17841 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4492,9 +4492,9 @@ fn parse_foreign_items(&self, first_item_attrs: ~[attribute], self.span_err(view_item.span, "`use` and `extern mod` declarations must precede items"); } - iovi_item(_) => { + iovi_item(item) => { // FIXME #5668: this will occur for a macro invocation: - fail!(); + self.span_fatal(item.span, "macros cannot expand to foreign items"); } iovi_foreign_item(foreign_item) => { foreign_items.push(foreign_item);