diff options
| author | bors <bors@rust-lang.org> | 2015-09-20 05:44:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-09-20 05:44:45 +0000 |
| commit | fd38a75077a4c5efc87413b7f9f7f1b6bc9db9af (patch) | |
| tree | ab20436d8ce7832e042629ad6b0c2f00787a278d /src/libsyntax | |
| parent | fbce4503f887ce1b3209feea4c8d15080e8ec241 (diff) | |
| parent | e2f3e3ac4f79fbfb872863135a732e9d4ccdbe6c (diff) | |
| download | rust-fd38a75077a4c5efc87413b7f9f7f1b6bc9db9af.tar.gz rust-fd38a75077a4c5efc87413b7f9f7f1b6bc9db9af.zip | |
Auto merge of #28503 - marcusklaas:pub-extern, r=alexcrichton
Fixes https://github.com/rust-lang/rust/issues/28472.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 7f57170c2ef..c01321d3f54 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -5037,9 +5037,8 @@ impl<'a> Parser<'a> { } /// Parse a function declaration from a foreign module - fn parse_item_foreign_fn(&mut self, vis: ast::Visibility, + fn parse_item_foreign_fn(&mut self, vis: ast::Visibility, lo: BytePos, attrs: Vec<Attribute>) -> PResult<P<ForeignItem>> { - let lo = self.span.lo; try!(self.expect_keyword(keywords::Fn)); let (ident, mut generics) = try!(self.parse_fn_header()); @@ -5058,10 +5057,8 @@ impl<'a> Parser<'a> { } /// Parse a static item from a foreign module - fn parse_item_foreign_static(&mut self, vis: ast::Visibility, + fn parse_item_foreign_static(&mut self, vis: ast::Visibility, lo: BytePos, attrs: Vec<Attribute>) -> PResult<P<ForeignItem>> { - let lo = self.span.lo; - try!(self.expect_keyword(keywords::Static)); let mutbl = try!(self.eat_keyword(keywords::Mut)); @@ -5557,11 +5554,11 @@ impl<'a> Parser<'a> { if self.check_keyword(keywords::Static) { // FOREIGN STATIC ITEM - return Ok(Some(try!(self.parse_item_foreign_static(visibility, attrs)))); + return Ok(Some(try!(self.parse_item_foreign_static(visibility, lo, attrs)))); } if self.check_keyword(keywords::Fn) || self.check_keyword(keywords::Unsafe) { // FOREIGN FUNCTION ITEM - return Ok(Some(try!(self.parse_item_foreign_fn(visibility, attrs)))); + return Ok(Some(try!(self.parse_item_foreign_fn(visibility, lo, attrs)))); } // FIXME #5668: this will occur for a macro invocation: |
