Skip to content

Commit 68b628b

Browse files
committed
std: Deprecate Vec::from_raw_buf
This function is more naturally expressed as slice::from_raw_buf plus a call to to_vec.
1 parent f85c4f6 commit 68b628b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/libcollections/vec.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ impl<T> Vec<T> {
278278
#[inline]
279279
#[unstable(feature = "vec_from_raw_buf",
280280
reason = "may be better expressed via composition")]
281+
#[deprecated(since = "1.2.0",
282+
reason = "use slice::from_raw_parts + .to_vec() instead")]
281283
pub unsafe fn from_raw_buf(ptr: *const T, elts: usize) -> Vec<T> {
282284
let mut dst = Vec::with_capacity(elts);
283285
dst.set_len(elts);

0 commit comments

Comments
 (0)