-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Open
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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
(I'm surprised I couldn't find an issue for this!)
The documentation page for the primitive array type ideally should include the methods defined on slices. (see e.g. this report of confusion on the forum)
This could be tricky; it looks like this capability is basically hardcoded into the compiler, so rustdoc would need to special-case it. (it can't rely on Deref like it can for Vec)
As an aside, the page contains some misleading language:
Arrays coerce to slices (
[T]), so a slice method may be called on an array.
This suggests that coercions enable method access, but there's plenty of coercions in Rust that do not, including other Unsize coercions like &T -> &dyn Trait.
RustyYato, OptimisticPeach, emmatyping and LukasKalbertodt
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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.