Skip to content

Vec::extend_from_slice’s documentation forgot about the difference of T: Clone vs. T: Copy bounds. #97119

Closed
@steffahn

Description

@steffahn

Quoting from https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#method.extend_from_slice

Note that this function is same as extend except that it is specialized to work with slices instead.

But Vec::extend_from_slice supports &[T] for T: Clone, whereas Vec::extend only supports impl Iterator<Item = &T> if T: Copy, so it’s not the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-sliceArea: `[T]`T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions