slice::fill documentation does not mention usage with uninitialized memory #119423
Labels
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
C-discussion
Category: Discussion or questions that doesn't represent real issues.
Location
https://doc.rust-lang.org/std/primitive.slice.html#method.fill
Summary
slice::fill
has an aliasmemset
which implies it can be used whenself
's underlying memory is uninitialized.The description for
slice::fill
is very short and does not mention this use case, so it seems unclear if this is intended behaviour or not. Some external discussions already mention the function as a safe way to initialize memory with aT: Clone
type.The text was updated successfully, but these errors were encountered: