File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -365,14 +365,15 @@ impl<T: ?Sized> Box<T> {
365
365
unsafe { mem:: transmute ( b) }
366
366
}
367
367
368
- /// Consumes and leaks the `Box`, returning a static reference,
369
- /// `&'static T`.
368
+ /// Consumes and leaks the `Box`, returning a static mutable reference,
369
+ /// `&'static mut T`.
370
370
///
371
371
/// This function is mainly useful for data that lives for the remainder of
372
- /// the programs life. Dropping the returned reference will cause a memory
372
+ /// the program's life. Dropping the returned reference will cause a memory
373
373
/// leak. If this is not acceptable, the reference should first be wrapped
374
- /// with the [`Box::from_raw`] function producing a `Box` which can then be
375
- /// dropped which will properly destroy `T` and release the memory.
374
+ /// with the [`Box::from_raw`] function producing a `Box`. This `Box` can
375
+ /// then be dropped which will properly destroy `T` and release the
376
+ /// allocated memory.
376
377
///
377
378
/// Note: this is an associated function, which means that you have
378
379
/// to call it as `Box::leak(b)` instead of `b.leak()`. This
You can’t perform that action at this time.
0 commit comments