Skip to content

Commit dd890d8

Browse files
authored
Rollup merge of rust-lang#48110 - Centril:stabilize/box_leak, r=alexcrichton
Stabilize Box::leak Stabilizes the following: + `Box::leak` (`box_leak`, in nightly since 2017-11-23) cc rust-lang#46179 r? @rust-lang/libs
2 parents edfdfc2 + 4861603 commit dd890d8

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/liballoc/boxed.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,6 @@ impl<T: ?Sized> Box<T> {
359359
/// Simple usage:
360360
///
361361
/// ```
362-
/// #![feature(box_leak)]
363-
///
364362
/// fn main() {
365363
/// let x = Box::new(41);
366364
/// let static_ref: &'static mut usize = Box::leak(x);
@@ -372,17 +370,14 @@ impl<T: ?Sized> Box<T> {
372370
/// Unsized data:
373371
///
374372
/// ```
375-
/// #![feature(box_leak)]
376-
///
377373
/// fn main() {
378374
/// let x = vec![1, 2, 3].into_boxed_slice();
379375
/// let static_ref = Box::leak(x);
380376
/// static_ref[0] = 4;
381377
/// assert_eq!(*static_ref, [4, 2, 3]);
382378
/// }
383379
/// ```
384-
#[unstable(feature = "box_leak", reason = "needs an FCP to stabilize",
385-
issue = "46179")]
380+
#[stable(feature = "box_leak", since = "1.26.0")]
386381
#[inline]
387382
pub fn leak<'a>(b: Box<T>) -> &'a mut T
388383
where

0 commit comments

Comments
 (0)