Skip to content

Misleading doc about Vec::into_boxed_slice #98908

Closed
@ark0f

Description

@ark0f

Location

Vec::into_boxed_slice
impl From<Vec<T>> for Box<[T]>

Summary

impl From<Vec<T>> for Box<[T]> says:

If v has excess capacity, its items will be moved into a newly-allocated buffer with exactly the right capacity.

When Vec::into_boxed_slice does not:

Note that this will drop any excess capacity.

Despite the fact that impl From<Vec<T>> for Box<[T]> uses Vec::into_boxed_slice inside

Metadata

Metadata

Labels

A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions