Fix rustdoc not correctly showing attributes with re-exports

Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
(cherry picked from commit 58418d881a)
This commit is contained in:
Jonathan Brouwer
2025-06-27 12:29:26 +02:00
committed by Josh Stone
parent 7e0eb3bc6d
commit d499468525
2 changed files with 15 additions and 1 deletions
+2 -1
View File
@@ -2746,7 +2746,8 @@ fn add_without_unwanted_attributes<'hir>(
attrs.push((Cow::Owned(attr), import_parent));
}
}
hir::Attribute::Parsed(..) if is_inline => {
// FIXME: make sure to exclude `#[cfg_trace]` here when it is ported to the new parsers
hir::Attribute::Parsed(..) => {
attrs.push((Cow::Owned(attr), import_parent));
}
_ => {}
+13
View File
@@ -0,0 +1,13 @@
// Tests that attributes are correctly copied onto a re-exported item.
//@ edition:2021
#![crate_name = "re_export"]
//@ has 're_export/fn.thingy2.html' '//pre[@class="rust item-decl"]' '#[no_mangle]'
pub use thingymod::thingy as thingy2;
mod thingymod {
#[no_mangle]
pub fn thingy() {
}
}