@@ -45,14 +45,13 @@ impl<'a> Parser<'a> {
45
45
pub ( super ) fn parse_item_mod ( & mut self , attrs : & mut Vec < Attribute > ) -> PResult < ' a , ItemInfo > {
46
46
let in_cfg = crate :: config:: process_configure_mod ( self . sess , self . cfg_mods , attrs) ;
47
47
48
- let id_span = self . token . span ;
49
48
let id = self . parse_ident ( ) ?;
50
49
let ( module, mut inner_attrs) = if self . eat ( & token:: Semi ) {
51
50
if in_cfg && self . recurse_into_file_modules {
52
51
// This mod is in an external file. Let's go get it!
53
52
let ModulePathSuccess { path, directory_ownership } =
54
- self . submod_path ( id, & attrs, id_span ) ?;
55
- self . eval_src_mod ( path, directory_ownership, id. to_string ( ) , id_span ) ?
53
+ self . submod_path ( id, & attrs) ?;
54
+ self . eval_src_mod ( path, directory_ownership, id. to_string ( ) , id . span ) ?
56
55
} else {
57
56
( ast:: Mod { inner : DUMMY_SP , items : Vec :: new ( ) , inline : false } , Vec :: new ( ) )
58
57
}
@@ -99,7 +98,6 @@ impl<'a> Parser<'a> {
99
98
& mut self ,
100
99
id : ast:: Ident ,
101
100
outer_attrs : & [ Attribute ] ,
102
- id_sp : Span ,
103
101
) -> PResult < ' a , ModulePathSuccess > {
104
102
if let Some ( path) = Parser :: submod_path_from_attr ( outer_attrs, & self . directory . path ) {
105
103
let directory_ownership = match path. file_name ( ) . and_then ( |s| s. to_str ( ) ) {
@@ -125,10 +123,10 @@ impl<'a> Parser<'a> {
125
123
126
124
match self . directory . ownership {
127
125
DirectoryOwnership :: Owned { .. } => {
128
- paths. result . map_err ( |err| self . span_fatal_err ( id_sp , err) )
126
+ paths. result . map_err ( |err| self . span_fatal_err ( id . span , err) )
129
127
}
130
- DirectoryOwnership :: UnownedViaBlock => self . error_decl_mod_in_block ( id_sp , paths) ,
131
- DirectoryOwnership :: UnownedViaMod => self . error_cannot_declare_mod_here ( id_sp , paths) ,
128
+ DirectoryOwnership :: UnownedViaBlock => self . error_decl_mod_in_block ( id . span , paths) ,
129
+ DirectoryOwnership :: UnownedViaMod => self . error_cannot_declare_mod_here ( id . span , paths) ,
132
130
}
133
131
}
134
132
0 commit comments