Skip to content

Commit d6b4fde

Browse files
committed
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`
2 parents 6a09b6f + 9c8d0e3 commit d6b4fde

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
@@ -4503,9 +4503,9 @@ impl Parser {
45034503
self.span_err(view_item.span,
45044504
"`use` and `extern mod` declarations must precede items");
45054505
}
4506-
iovi_item(_) => {
4506+
iovi_item(item) => {
45074507
// FIXME #5668: this will occur for a macro invocation:
4508-
fail!();
4508+
self.span_fatal(item.span, "macros cannot expand to foreign items");
45094509
}
45104510
iovi_foreign_item(foreign_item) => {
45114511
foreign_items.push(foreign_item);

0 commit comments

Comments
 (0)