Documentation for Clone
is inaccurate w/r/t large arrays (always?) not implementing Clone
.
#48646
Labels
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
E-hard
Call for participation: Hard difficulty. Experience needed to fix: A lot.
P-medium
Medium priority
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
Currently, the
Clone
docs state thatClone
is not implemented for arrays with more than 32 elements:rust/src/libcore/clone.rs
Lines 73 to 89 in 3eeb5a6
This seems to be untrue, at least for the given example: playground. This must've been the case since at least 1.21.0.
I would fix this myself, but unfortunately, from the PR linked in the changelog, I'm not quite sure in which circumstances
Clone
is now auto-implemented. I didn't just want to rip out the example without providing a new one that makes more sense for the current situation.Edit: to prevent this from happening again, it might be nice to have an additional
compile_fail
-style example in the docs to show what doesn't work, so that doctests can catch it.The text was updated successfully, but these errors were encountered: