Rollup merge of #143083 - JonathanBrouwer:rustdoc-fix, r=jdonszelmann
Fix rustdoc not correctly showing attributes on re-exports Fixes attributes not being shown correctly in rustdoc on re-exports Does this need to be backported to beta? r? ``@jdonszelmann``
This commit is contained in:
commit
622722aada
2 changed files with 15 additions and 1 deletions
|
|
@ -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
tests/rustdoc/attributes-re-export.rs
Normal file
13
tests/rustdoc/attributes-re-export.rs
Normal 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() {
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue