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 @@ -2679,15 +2679,11 @@ fn add_without_unwanted_attributes<'hir>(
26792679 import_parent,
26802680 ) ) ;
26812681 }
2682- hir:: Attribute :: Unparsed ( ..) => {
2683- attrs. push ( ( Cow :: Borrowed ( attr) , import_parent) ) ;
2684- }
2685- // FIXME: make sure to exclude `#[cfg_trace]` here when it is ported to the new parsers
2686- hir:: Attribute :: Parsed ( parsed) => {
2687- if
2682+ // If it's not a `cfg()` attribute, we keep it.
2683+ hir:: Attribute :: Parsed ( AttributeKind :: CfgTrace ( ..) ) if !is_inline => { }
2684+ _ => {
26882685 attrs. push ( ( Cow :: Borrowed ( attr) , import_parent) ) ;
26892686 }
2690- _ => { }
26912687 }
26922688 }
26932689}
You can’t perform that action at this time.
0 commit comments