@@ -6252,6 +6252,7 @@ impl<'a> Parser<'a> {
6252
6252
Ok ( ast:: Mod {
6253
6253
inner : inner_lo. to ( hi) ,
6254
6254
items,
6255
+ inline : true
6255
6256
} )
6256
6257
}
6257
6258
@@ -6287,8 +6288,10 @@ impl<'a> Parser<'a> {
6287
6288
// This mod is in an external file. Let's go get it!
6288
6289
let ModulePathSuccess { path, directory_ownership, warn } =
6289
6290
self . submod_path ( id, & outer_attrs, id_span) ?;
6290
- let ( module, mut attrs) =
6291
+ let ( mut module, mut attrs) =
6291
6292
self . eval_src_mod ( path, directory_ownership, id. to_string ( ) , id_span) ?;
6293
+ // Record that we fetched the mod from an external file
6294
+ module. inline = false ;
6292
6295
if warn {
6293
6296
let attr = Attribute {
6294
6297
id : attr:: mk_attr_id ( ) ,
@@ -6301,9 +6304,13 @@ impl<'a> Parser<'a> {
6301
6304
attr:: mark_known ( & attr) ;
6302
6305
attrs. push ( attr) ;
6303
6306
}
6304
- Ok ( ( id, module, Some ( attrs) ) )
6307
+ Ok ( ( id, ItemKind :: Mod ( module) , Some ( attrs) ) )
6305
6308
} else {
6306
- let placeholder = ast:: Mod { inner : syntax_pos:: DUMMY_SP , items : Vec :: new ( ) } ;
6309
+ let placeholder = ast:: Mod {
6310
+ inner : syntax_pos:: DUMMY_SP ,
6311
+ items : Vec :: new ( ) ,
6312
+ inline : false
6313
+ } ;
6307
6314
Ok ( ( id, ItemKind :: Mod ( placeholder) , None ) )
6308
6315
}
6309
6316
} else {
@@ -6503,7 +6510,7 @@ impl<'a> Parser<'a> {
6503
6510
directory_ownership : DirectoryOwnership ,
6504
6511
name : String ,
6505
6512
id_sp : Span )
6506
- -> PResult < ' a , ( ast:: ItemKind , Vec < Attribute > ) > {
6513
+ -> PResult < ' a , ( ast:: Mod , Vec < Attribute > ) > {
6507
6514
let mut included_mod_stack = self . sess . included_mod_stack . borrow_mut ( ) ;
6508
6515
if let Some ( i) = included_mod_stack. iter ( ) . position ( |p| * p == path) {
6509
6516
let mut err = String :: from ( "circular modules: " ) ;
@@ -6525,7 +6532,7 @@ impl<'a> Parser<'a> {
6525
6532
let mod_attrs = p0. parse_inner_attributes ( ) ?;
6526
6533
let m0 = p0. parse_mod_items ( & token:: Eof , mod_inner_lo) ?;
6527
6534
self . sess . included_mod_stack . borrow_mut ( ) . pop ( ) ;
6528
- Ok ( ( ast :: ItemKind :: Mod ( m0 ) , mod_attrs) )
6535
+ Ok ( ( m0 , mod_attrs) )
6529
6536
}
6530
6537
6531
6538
/// Parse a function declaration from a foreign module
0 commit comments