diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-06-10 18:40:20 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-06-17 09:07:16 -0700 |
| commit | 68b628b165c91e6abe1bccf9d94eb7c7ef7cdda3 (patch) | |
| tree | 2ffa850b6f68fd59d678795ff85ec401ea8bacec | |
| parent | f85c4f62d8e3f703f9d7c801b982d5cd5afbd081 (diff) | |
| download | rust-68b628b165c91e6abe1bccf9d94eb7c7ef7cdda3.tar.gz rust-68b628b165c91e6abe1bccf9d94eb7c7ef7cdda3.zip | |
std: Deprecate Vec::from_raw_buf
This function is more naturally expressed as slice::from_raw_buf plus a call to to_vec.
| -rw-r--r-- | src/libcollections/vec.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index 3d7c82c9a94..6b1e4bb4f8e 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -278,6 +278,8 @@ impl<T> Vec<T> { #[inline] #[unstable(feature = "vec_from_raw_buf", reason = "may be better expressed via composition")] + #[deprecated(since = "1.2.0", + reason = "use slice::from_raw_parts + .to_vec() instead")] pub unsafe fn from_raw_buf(ptr: *const T, elts: usize) -> Vec<T> { let mut dst = Vec::with_capacity(elts); dst.set_len(elts); |
