File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed
Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -859,12 +859,16 @@ pub(crate) fn extract_cfg_from_attrs<'a, I: Iterator<Item = &'a hir::Attribute>
859859 }
860860 continue ;
861861 } else if !cfg_info. parent_is_doc_cfg
862- && let Some ( ident) = attr. ident ( )
863- && matches ! ( ident. name, sym:: cfg | sym:: cfg_trace)
864- && let Some ( attr) = single ( attr. meta_item_list ( ) ?)
865- && let Ok ( new_cfg) = Cfg :: parse ( & attr)
862+ && let hir:: Attribute :: Parsed ( AttributeKind :: CfgTrace ( cfgs, _) ) = attr
863+
864+ // && let Some(ident) = attr.ident()
865+ // && matches!(ident.name, sym::cfg | sym::cfg_trace)
866+ // && let Some(attr) = single(attr.meta_item_list()?)
867+ // && let Ok(new_cfg) = Cfg::parse(&attr)
866868 {
867- cfg_info. current_cfg &= new_cfg;
869+ for new_cfg in cfgs {
870+ cfg_info. current_cfg &= Cfg ( new_cfg. clone ( ) ) ;
871+ }
868872 }
869873 }
870874
Original file line number Diff line number Diff line change @@ -2673,15 +2673,11 @@ fn add_without_unwanted_attributes<'hir>(
26732673 import_parent,
26742674 ) ) ;
26752675 }
2676- hir:: Attribute :: Unparsed ( ..) => {
2677- attrs. push ( ( Cow :: Borrowed ( attr) , import_parent) ) ;
2678- }
2679- // FIXME: make sure to exclude `#[cfg_trace]` here when it is ported to the new parsers
2680- hir:: Attribute :: Parsed ( parsed) => {
2681- if
2676+ // If it's not a `cfg()` attribute, we keep it.
2677+ hir:: Attribute :: Parsed ( AttributeKind :: CfgTrace ( ..) ) if !is_inline => { }
2678+ _ => {
26822679 attrs. push ( ( Cow :: Borrowed ( attr) , import_parent) ) ;
26832680 }
2684- _ => { }
26852681 }
26862682 }
26872683}
You can’t perform that action at this time.
0 commit comments