@@ -5037,9 +5037,8 @@ impl<'a> Parser<'a> {
5037
5037
}
5038
5038
5039
5039
/// 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 ,
5041
5041
attrs : Vec < Attribute > ) -> PResult < P < ForeignItem > > {
5042
- let lo = self . span . lo ;
5043
5042
try!( self . expect_keyword ( keywords:: Fn ) ) ;
5044
5043
5045
5044
let ( ident, mut generics) = try!( self . parse_fn_header ( ) ) ;
@@ -5058,10 +5057,8 @@ impl<'a> Parser<'a> {
5058
5057
}
5059
5058
5060
5059
/// 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 ,
5062
5061
attrs : Vec < Attribute > ) -> PResult < P < ForeignItem > > {
5063
- let lo = self . span . lo ;
5064
-
5065
5062
try!( self . expect_keyword ( keywords:: Static ) ) ;
5066
5063
let mutbl = try!( self . eat_keyword ( keywords:: Mut ) ) ;
5067
5064
@@ -5554,11 +5551,11 @@ impl<'a> Parser<'a> {
5554
5551
5555
5552
if self . check_keyword ( keywords:: Static ) {
5556
5553
// 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) ) ) ) ;
5558
5555
}
5559
5556
if self . check_keyword ( keywords:: Fn ) || self . check_keyword ( keywords:: Unsafe ) {
5560
5557
// 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) ) ) ) ;
5562
5559
}
5563
5560
5564
5561
// FIXME #5668: this will occur for a macro invocation:
0 commit comments