diff options
| author | James Miller <james@aatch.net> | 2013-06-07 11:28:38 +1200 |
|---|---|---|
| committer | James Miller <james@aatch.net> | 2013-06-07 11:28:38 +1200 |
| commit | 9c8d0e375e36e091e87dbd2bdf6022562bdb41c4 (patch) | |
| tree | 7973e4bd1579fa4134ae2cf29fd50773d7e7a012 /src/libsyntax | |
| parent | 13aa18891c0615f8db193ae61e80fa16f567afd1 (diff) | |
| download | rust-9c8d0e375e36e091e87dbd2bdf6022562bdb41c4.tar.gz rust-9c8d0e375e36e091e87dbd2bdf6022562bdb41c4.zip | |
Provide an actual error when expanding macros to foreign items
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 4 |
1 files 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 @@ 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); |
