@@ -5037,9 +5037,8 @@ impl<'a> Parser<'a> {
50375037 }
50385038
50395039 /// Parse a function declaration from a foreign module
5040- fn parse_item_foreign_fn ( & mut self , vis : ast:: Visibility ,
5040+ fn parse_item_foreign_fn ( & mut self , vis : ast:: Visibility , lo : BytePos ,
50415041 attrs : Vec < Attribute > ) -> PResult < P < ForeignItem > > {
5042- let lo = self . span . lo ;
50435042 try!( self . expect_keyword ( keywords:: Fn ) ) ;
50445043
50455044 let ( ident, mut generics) = try!( self . parse_fn_header ( ) ) ;
@@ -5058,10 +5057,8 @@ impl<'a> Parser<'a> {
50585057 }
50595058
50605059 /// Parse a static item from a foreign module
5061- fn parse_item_foreign_static ( & mut self , vis : ast:: Visibility ,
5060+ fn parse_item_foreign_static ( & mut self , vis : ast:: Visibility , lo : BytePos ,
50625061 attrs : Vec < Attribute > ) -> PResult < P < ForeignItem > > {
5063- let lo = self . span . lo ;
5064-
50655062 try!( self . expect_keyword ( keywords:: Static ) ) ;
50665063 let mutbl = try!( self . eat_keyword ( keywords:: Mut ) ) ;
50675064
@@ -5554,11 +5551,11 @@ impl<'a> Parser<'a> {
55545551
55555552 if self . check_keyword ( keywords:: Static ) {
55565553 // FOREIGN STATIC ITEM
5557- return Ok ( Some ( try!( self . parse_item_foreign_static ( visibility, attrs) ) ) ) ;
5554+ return Ok ( Some ( try!( self . parse_item_foreign_static ( visibility, lo , attrs) ) ) ) ;
55585555 }
55595556 if self . check_keyword ( keywords:: Fn ) || self . check_keyword ( keywords:: Unsafe ) {
55605557 // FOREIGN FUNCTION ITEM
5561- return Ok ( Some ( try!( self . parse_item_foreign_fn ( visibility, attrs) ) ) ) ;
5558+ return Ok ( Some ( try!( self . parse_item_foreign_fn ( visibility, lo , attrs) ) ) ) ;
55625559 }
55635560
55645561 // FIXME #5668: this will occur for a macro invocation:
0 commit comments