From ea4a36b47492aa28bce16e23b9940d3e5704c39d Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 1 Feb 2024 11:45:35 +0100 Subject: [PATCH] Fix handling of `doc_auto_cfg` feature for `cfg` attributes on glob reexport --- src/librustdoc/clean/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index bd1d68e7074..fd1c11c774d 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -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)); }