@@ -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
@@ -5557,11 +5554,11 @@ impl<'a> Parser<'a> {
55575554
55585555 if self . check_keyword ( keywords:: Static ) {
55595556 // FOREIGN STATIC ITEM
5560- return Ok ( Some ( try!( self . parse_item_foreign_static ( visibility, attrs) ) ) ) ;
5557+ return Ok ( Some ( try!( self . parse_item_foreign_static ( visibility, lo , attrs) ) ) ) ;
55615558 }
55625559 if self . check_keyword ( keywords:: Fn ) || self . check_keyword ( keywords:: Unsafe ) {
55635560 // FOREIGN FUNCTION ITEM
5564- return Ok ( Some ( try!( self . parse_item_foreign_fn ( visibility, attrs) ) ) ) ;
5561+ return Ok ( Some ( try!( self . parse_item_foreign_fn ( visibility, lo , attrs) ) ) ) ;
55655562 }
55665563
55675564 // FIXME #5668: this will occur for a macro invocation:
0 commit comments