about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorP1start <rewi-github@whanau.org>2015-05-16 22:35:59 +1200
committerP1start <rewi-github@whanau.org>2015-05-16 22:35:59 +1200
commitdadac15477f0ad55c742d46fe384e2b71b0bf898 (patch)
treef0fd3e03f6616b1c7cd348a111be8b4cf49e7950 /src/libsyntax/parse
parent716f920b7e234b450f272346fea961832505c06e (diff)
downloadrust-dadac15477f0ad55c742d46fe384e2b71b0bf898.tar.gz
rust-dadac15477f0ad55c742d46fe384e2b71b0bf898.zip
Clarify the error message for malformed `extern crate` statements
Closes #25468.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 9bf6fa88ba5..05d6cbf0a7e 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -5266,11 +5266,7 @@ impl<'a> Parser<'a> {
                 return Ok(Some(try!(self.parse_item_foreign_mod(lo, opt_abi, visibility, attrs))));
             }
 
-            let span = self.span;
-            let token_str = self.this_token_to_string();
-            return Err(self.span_fatal(span,
-                            &format!("expected `{}` or `fn`, found `{}`", "{",
-                                    token_str)))
+            try!(self.expect_one_of(&[], &[]));
         }
 
         if try!(self.eat_keyword_noexpect(keywords::Virtual) ){