Open
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
.