about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-06-06 16:52:36 -0700
committerbors <bors@rust-lang.org>2013-06-06 16:52:36 -0700
commitd6b4fde97e71e54a85f0e1b1e66bca7a50111deb (patch)
tree3a046cc50a2413588648e23f5e8dabb336d6a89a /src/libsyntax/parse
parent6a09b6f0c325dcef72fd623b89064df868c96412 (diff)
parent9c8d0e375e36e091e87dbd2bdf6022562bdb41c4 (diff)
downloadrust-d6b4fde97e71e54a85f0e1b1e66bca7a50111deb.tar.gz
rust-d6b4fde97e71e54a85f0e1b1e66bca7a50111deb.zip
auto merge of #6982 : Aatch/rust/better-foreign-error, r=pcwalton
I encountered this. A straight fail is not useful and most people aren't going to happily spelunk in `parser.rs`
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 300e5adcf92..8ebb7de0bfe 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -4503,9 +4503,9 @@ impl Parser {
                     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);