@@ -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
@@ -5557,11 +5554,11 @@ impl<'a> Parser<'a> {
5557
5554
5558
5555
if self . check_keyword ( keywords:: Static ) {
5559
5556
// 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) ) ) ) ;
5561
5558
}
5562
5559
if self . check_keyword ( keywords:: Fn ) || self . check_keyword ( keywords:: Unsafe ) {
5563
5560
// 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) ) ) ) ;
5565
5562
}
5566
5563
5567
5564
// FIXME #5668: this will occur for a macro invocation:
0 commit comments