Stabilize Vec::leak
This commit is contained in:
parent
d8bcf75206
commit
7d759f539f
@ -1510,14 +1510,12 @@ impl<T> Vec<T> {
|
|||||||
/// Simple usage:
|
/// Simple usage:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// #![feature(vec_leak)]
|
|
||||||
///
|
|
||||||
/// let x = vec![1, 2, 3];
|
/// let x = vec![1, 2, 3];
|
||||||
/// let static_ref: &'static mut [usize] = x.leak();
|
/// let static_ref: &'static mut [usize] = x.leak();
|
||||||
/// static_ref[0] += 1;
|
/// static_ref[0] += 1;
|
||||||
/// assert_eq!(static_ref, &[2, 2, 3]);
|
/// assert_eq!(static_ref, &[2, 2, 3]);
|
||||||
/// ```
|
/// ```
|
||||||
#[unstable(feature = "vec_leak", issue = "62195")]
|
#[stable(feature = "vec_leak", since = "1.47.0")]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn leak<'a>(self) -> &'a mut [T]
|
pub fn leak<'a>(self) -> &'a mut [T]
|
||||||
where
|
where
|
||||||
|
Loading…
Reference in New Issue
Block a user