Reproduction:
rustc a.rs --crate-type lib --edition 2024 a.rs where a.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 where b.rs:
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).
Reproduction:
rustc a.rs --crate-type lib --edition 2024 a.rswherea.rs:rustdoc b.rs --edition 2024 -L. --extern awhereb.rs:Behavior:
#[no_mangle]s but not the#[link_section]sThe attributes
#[repr],#[non_exhaustive]&#[export_name]are unaffected (i.e., the remaining allowlisted non-doc attrs).