Repository navigation
Re-exported types have confusingly different documentation #44306
Description
Activity
- addedT-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.
on Sep 4, 2017 Dark magic! 😆
I'll take a look later.
cc #24305
- addedC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.Relevant to the dev-tools subteam, which will review and decide on the PR/issue.
on Sep 17, 2017 - addedA-cross-crate-reexportsArea: Documentation that has been re-exported from a different crateArea: Documentation that has been re-exported from a different crate
on Oct 12, 2020 I think this is a cross-crate reexports issue, so labeling as such.
Triage as of rustdoc 1.50.0-nightly (0f6f2d6 2020-12-06): This bug has gone away:
The where clause gives an explicit -> ().
The rest are still changed from the inner crate.
I expect this is an inconsistency between how
cleantreats HIR andrustc_middle::tysomewhere (the difference being thattyworks off serialized metadata).- removedT-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.Relevant to the dev-tools subteam, which will review and decide on the PR/issue.
on Jan 18, 2022 Temporarily assigning myself to this issue since I am working on fixing several issues related to the handling of cross-crate trait object types in rustdoc and other minor cross-crate things. I won't fix everything mentioned in this issue however, hence this is only a temporary assignment until the PR is open.
Reacted by jyn- addedC-bugCategory: This is a bug.Category: This is a bug.and removedC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
on Oct 27, 2022 4 remaining items
Update: Thanks to #103885, #107637 & #112463, the output is finally very close to acceptable (source vs. rendered):
- pub fn f<F>(_: F, _: Box<dyn T>) -> Self - where F: Fn() + pub fn f<F>(_: F, _: Box<dyn T>) -> S + where + F: Fn(),
The remaining issue concerns
Selftypes in cross-crate scenarios. I'm not gonna work on a PR for that in the foreseeable future but at some point I will probably submit a PR for it. I predict it to be a bit nasty performance-wise since it requires performing type unification on everyTyinside animpl.Reacted by jyn- added a commit that references this issue
on Oct 30, 2023 - added 3 commits that reference this issue
on Apr 17, 2025 - added a commit that references this issue
on Apr 18, 2025


Re-exported types seem to have more confusing documentation than the original type. I noticed this while reviewing rayon::Configuration which is re-exported from rayon-core.
original/src/lib.rs
This is documented basically like what I wrote, which is what I would expect:
src/lib.rs
This is documented with a couple changes, all of which are technically correct but unexpected.
Box<T>is nowBox<T + 'static>.SelftoS.Thefixed as of 1.50whereclause gives an explicit-> ().I am using rustc 1.22.0-nightly (f861b6e 2017-09-01).
@GuillaumeGomez