Skip to content

Commit

Permalink
Stabilize Vec::leak
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Jul 29, 2020
1 parent d8bcf75 commit 7d759f5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions library/alloc/src/vec.rs
Expand Up @@ -1510,14 +1510,12 @@ impl<T> Vec<T> {
/// Simple usage:
///
/// ```
/// #![feature(vec_leak)]
///
/// let x = vec![1, 2, 3];
/// let static_ref: &'static mut [usize] = x.leak();
/// static_ref[0] += 1;
/// assert_eq!(static_ref, &[2, 2, 3]);
/// ```
#[unstable(feature = "vec_leak", issue = "62195")]
#[stable(feature = "vec_leak", since = "1.47.0")]
#[inline]
pub fn leak<'a>(self) -> &'a mut [T]
where
Expand Down

0 comments on commit 7d759f5

Please sign in to comment.