-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-cross-crate-reexportsArea: Documentation that has been re-exported from a different crateArea: Documentation that has been re-exported from a different crateC-bugCategory: This is a bug.Category: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
Reproduction:
rustc a.rs --crate-type lib --edition 2024 a.rs
wherea.rs
:#[unsafe(no_mangle)] pub fn f0() {} #[unsafe(link_section = ".here")] pub fn f1() {} #[unsafe(no_mangle)] pub static S0: () = (); #[unsafe(link_section = ".there")] pub static S1: () = ();
rustdoc b.rs --edition 2024 -L. --extern a
whereb.rs
:pub use a::*;
Behavior:
- On 1.88.0 (current stable), rustdoc doesn't render any of these attributes
- On 1.89.0-beta.5 (current beta), rustdoc renders the
#[no_mangle]
s but not the#[link_section]
s - On 1.90.0-nightly (3014e79 2025-07-15) (current master), rustdoc doesn't render any of these attributes yet again
The attributes #[repr]
, #[non_exhaustive]
& #[export_name]
are unaffected (i.e., the remaining allowlisted non-doc attrs).
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-cross-crate-reexportsArea: Documentation that has been re-exported from a different crateArea: Documentation that has been re-exported from a different crateC-bugCategory: This is a bug.Category: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.