File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ impl<'a> StripUnconfigured<'a> {
3333 if self . in_cfg ( node. attrs ( ) ) { Some ( node) } else { None }
3434 }
3535
36- fn process_cfg_attrs < T : HasAttrs > ( & mut self , node : T ) -> T {
36+ pub fn process_cfg_attrs < T : HasAttrs > ( & mut self , node : T ) -> T {
3737 node. map_attrs ( |attrs| {
3838 attrs. into_iter ( ) . filter_map ( |attr| self . process_cfg_attr ( attr) ) . collect ( )
3939 } )
Original file line number Diff line number Diff line change @@ -5301,15 +5301,22 @@ impl<'a> Parser<'a> {
53015301
53025302 /// Parse a `mod <foo> { ... }` or `mod <foo>;` item
53035303 fn parse_item_mod ( & mut self , outer_attrs : & [ Attribute ] ) -> PResult < ' a , ItemInfo > {
5304+ let outer_attrs = :: config:: StripUnconfigured {
5305+ config : & self . cfg ,
5306+ sess : self . sess ,
5307+ should_test : false , // irrelevant
5308+ features : None , // don't perform gated feature checking
5309+ } . process_cfg_attrs ( outer_attrs. to_owned ( ) ) ;
5310+
53045311 let id_span = self . span ;
53055312 let id = self . parse_ident ( ) ?;
53065313 if self . check ( & token:: Semi ) {
53075314 self . bump ( ) ;
53085315 // This mod is in an external file. Let's go get it!
5309- let ( m, attrs) = self . eval_src_mod ( id, outer_attrs, id_span) ?;
5316+ let ( m, attrs) = self . eval_src_mod ( id, & outer_attrs, id_span) ?;
53105317 Ok ( ( id, m, Some ( attrs) ) )
53115318 } else {
5312- self . push_mod_path ( id, outer_attrs) ;
5319+ self . push_mod_path ( id, & outer_attrs) ;
53135320 self . expect ( & token:: OpenDelim ( token:: Brace ) ) ?;
53145321 let mod_inner_lo = self . span . lo ;
53155322 let attrs = self . parse_inner_attributes ( ) ?;
You can’t perform that action at this time.
0 commit comments