Sibling issue: #91187.
Currently, we semi-successfully try to hide the unstable MetaSized and PointeeSized bounds in all rustdoc-generated docs because we don't want to confuse and frighten readers of the stdlib API docs which is perfectly reasonable. For example, for inlined cross-crate re-exports (IXCRE) we don't try to reconstruct PointeeSized bounds (so we essentially hide them) and we drop MetaSized bound (so we basically replace MetaSized with ?Sized) bounds. Most notably, this affects std (since it re-exports core and alloc). However, it doesn't really concern core or alloc since HIR cleaning wasn't taught these rules (likely an oversight?).
The issue with this approach is twofold:
- Users who enable
sized_hierarchy for their own crates obviously know the feature but still rustdoc doesn't offer them a great experience
- rustdoc cannot properly "handle" sized hierarchy internally
- e.g., IXCRE
PointeeSized support isn't automatic, it needs dedicated code for reconstructing these bounds (which isn't hard but-)
- so a hypothetical stabilization PR for SH can't just switch over to the proper rendering by just flipping a switch somewhere
- it currently contains minor hacks everywhere instead of robust well thought-out code much to the detriment of maintainability (esp. wrt. legibility & extensibility)
Sibling issue: #91187.
Currently, we semi-successfully try to hide the unstable
MetaSizedandPointeeSizedbounds in all rustdoc-generated docs because we don't want to confuse and frighten readers of the stdlib API docs which is perfectly reasonable. For example, for inlined cross-crate re-exports (IXCRE) we don't try to reconstructPointeeSizedbounds (so we essentially hide them) and we dropMetaSizedbound (so we basically replaceMetaSizedwith?Sized) bounds. Most notably, this affectsstd(since it re-exportscoreandalloc). However, it doesn't really concerncoreorallocsince HIR cleaning wasn't taught these rules (likely an oversight?).The issue with this approach is twofold:
sized_hierarchyfor their own crates obviously know the feature but still rustdoc doesn't offer them a great experiencePointeeSizedsupport isn't automatic, it needs dedicated code for reconstructing these bounds (which isn't hard but-)