@@ -6166,6 +6166,7 @@ impl<'a> Parser<'a> {
6166
6166
Ok ( ast:: Mod {
6167
6167
inner : inner_lo. to ( hi) ,
6168
6168
items,
6169
+ inline : true
6169
6170
} )
6170
6171
}
6171
6172
@@ -6203,8 +6204,10 @@ impl<'a> Parser<'a> {
6203
6204
// This mod is in an external file. Let's go get it!
6204
6205
let ModulePathSuccess { path, directory_ownership, warn } =
6205
6206
self . submod_path ( id, & outer_attrs, id_span) ?;
6206
- let ( module, mut attrs) =
6207
+ let ( mut module, mut attrs) =
6207
6208
self . eval_src_mod ( path, directory_ownership, id. to_string ( ) , id_span) ?;
6209
+ // Record that we fetched the mod from an external file
6210
+ module. inline = false ;
6208
6211
if warn {
6209
6212
let attr = Attribute {
6210
6213
id : attr:: mk_attr_id ( ) ,
@@ -6217,9 +6220,13 @@ impl<'a> Parser<'a> {
6217
6220
attr:: mark_known ( & attr) ;
6218
6221
attrs. push ( attr) ;
6219
6222
}
6220
- Ok ( ( id, module, Some ( attrs) ) )
6223
+ Ok ( ( id, ItemKind :: Mod ( module) , Some ( attrs) ) )
6221
6224
} else {
6222
- let placeholder = ast:: Mod { inner : syntax_pos:: DUMMY_SP , items : Vec :: new ( ) } ;
6225
+ let placeholder = ast:: Mod {
6226
+ inner : syntax_pos:: DUMMY_SP ,
6227
+ items : Vec :: new ( ) ,
6228
+ inline : false
6229
+ } ;
6223
6230
Ok ( ( id, ItemKind :: Mod ( placeholder) , None ) )
6224
6231
}
6225
6232
} else {
@@ -6419,7 +6426,7 @@ impl<'a> Parser<'a> {
6419
6426
directory_ownership : DirectoryOwnership ,
6420
6427
name : String ,
6421
6428
id_sp : Span )
6422
- -> PResult < ' a , ( ast:: ItemKind , Vec < Attribute > ) > {
6429
+ -> PResult < ' a , ( ast:: Mod , Vec < Attribute > ) > {
6423
6430
let mut included_mod_stack = self . sess . included_mod_stack . borrow_mut ( ) ;
6424
6431
if let Some ( i) = included_mod_stack. iter ( ) . position ( |p| * p == path) {
6425
6432
let mut err = String :: from ( "circular modules: " ) ;
@@ -6441,7 +6448,7 @@ impl<'a> Parser<'a> {
6441
6448
let mod_attrs = p0. parse_inner_attributes ( ) ?;
6442
6449
let m0 = p0. parse_mod_items ( & token:: Eof , mod_inner_lo) ?;
6443
6450
self . sess . included_mod_stack . borrow_mut ( ) . pop ( ) ;
6444
- Ok ( ( ast :: ItemKind :: Mod ( m0 ) , mod_attrs) )
6451
+ Ok ( ( m0 , mod_attrs) )
6445
6452
}
6446
6453
6447
6454
/// Parse a function declaration from a foreign module
0 commit comments