Skip to content

Commit 6582009

Browse files
authored
Rollup merge of #99570 - XrXr:box-from-slice-docs, r=thomcc
Box::from(slice): Clarify that contents are copied A colleague mentioned that they interpreted the old text as saying that only the pointer and the length are copied. Add a clause so it is more clear that the pointed to contents are also copied.
2 parents 85916c7 + 321419e commit 6582009

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/alloc/src/boxed.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1485,7 +1485,7 @@ impl<T: Copy> From<&[T]> for Box<[T]> {
14851485
/// Converts a `&[T]` into a `Box<[T]>`
14861486
///
14871487
/// This conversion allocates on the heap
1488-
/// and performs a copy of `slice`.
1488+
/// and performs a copy of `slice` and its contents.
14891489
///
14901490
/// # Examples
14911491
/// ```rust

0 commit comments

Comments
 (0)