mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
0ab3a69f3c
rustdoc: preserve `doc(cfg)` on locally re-exported type aliases When a type alias is locally re-exported from a private module (an implicit inline), rustdoc drops its `cfg` attributes because it treats it like a standard un-inlined re-export. Since type aliases have no inner fields to carry the `cfg` badge (unlike structs or enums), the portability info is lost entirely. This patch explicitly preserves the target's `cfg` metadata when the generated item is a `TypeAliasItem`, ensuring the portability badge renders correctly without breaking standard cross-crate re-export behavior. Fixes rust-lang/rust#154921