Fix handling of doc_auto_cfg feature for cfg attributes on glob reexport

This commit is contained in:
Guillaume Gomez 2024-02-01 11:45:35 +01:00
parent 11f32b73e0
commit ea4a36b474

View File

@ -2722,7 +2722,7 @@ fn add_without_unwanted_attributes<'hir>(
if ident == sym::doc {
filter_doc_attr(normal, is_inline);
attrs.push((Cow::Owned(attr), import_parent));
} else if ident != sym::cfg {
} else if is_inline || ident != sym::cfg {
// If it's not a `cfg()` attribute, we keep it.
attrs.push((Cow::Owned(attr), import_parent));
}