Skip to content

Commit 193b9e5

Browse files
committed
Update documentation for from_raw_parts
Fixes #19269.
1 parent 48ca6d1 commit 193b9e5

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/libcollections/vec.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,9 @@ impl<T> Vec<T> {
195195
}
196196
}
197197

198-
/// Creates a `Vec<T>` directly from the raw constituents.
198+
/// Creates a `Vec<T>` directly from the raw components of another vector.
199199
///
200-
/// This is highly unsafe:
201-
///
202-
/// - if `ptr` is null, then `length` and `capacity` should be 0
203-
/// - `ptr` must point to an allocation of size `capacity`
204-
/// - there must be `length` valid instances of type `T` at the
205-
/// beginning of that allocation
206-
/// - `ptr` must be allocated by the default `Vec` allocator
200+
/// This is highly unsafe, due to the number of invariants that aren't checked.
207201
///
208202
/// # Example
209203
///

0 commit comments

Comments
 (0)