File tree 2 files changed +10
-3
lines changed
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> {
33
33
if self . in_cfg ( node. attrs ( ) ) { Some ( node) } else { None }
34
34
}
35
35
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 {
37
37
node. map_attrs ( |attrs| {
38
38
attrs. into_iter ( ) . filter_map ( |attr| self . process_cfg_attr ( attr) ) . collect ( )
39
39
} )
Original file line number Diff line number Diff line change @@ -5301,15 +5301,22 @@ impl<'a> Parser<'a> {
5301
5301
5302
5302
/// Parse a `mod <foo> { ... }` or `mod <foo>;` item
5303
5303
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
+
5304
5311
let id_span = self . span ;
5305
5312
let id = self . parse_ident ( ) ?;
5306
5313
if self . check ( & token:: Semi ) {
5307
5314
self . bump ( ) ;
5308
5315
// 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) ?;
5310
5317
Ok ( ( id, m, Some ( attrs) ) )
5311
5318
} else {
5312
- self . push_mod_path ( id, outer_attrs) ;
5319
+ self . push_mod_path ( id, & outer_attrs) ;
5313
5320
self . expect ( & token:: OpenDelim ( token:: Brace ) ) ?;
5314
5321
let mod_inner_lo = self . span . lo ;
5315
5322
let attrs = self . parse_inner_attributes ( ) ?;
You can’t perform that action at this time.
0 commit comments