diff options
| author | bors <bors@rust-lang.org> | 2016-01-14 13:42:59 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-01-14 13:42:59 +0000 |
| commit | 02fbf31fb26e0b5eccf34cef8a5f8becef6f3ada (patch) | |
| tree | 554d5d05b0c5f4baee9180cdec5fffd98c10239b /src/liballoc | |
| parent | 5b3a75fe560362b812f2c4947d449558a9472496 (diff) | |
| parent | a964c86d45577f089507a8ecf3e1dc6486166ac2 (diff) | |
| download | rust-02fbf31fb26e0b5eccf34cef8a5f8becef6f3ada.tar.gz rust-02fbf31fb26e0b5eccf34cef8a5f8becef6f3ada.zip | |
Auto merge of #30897 - Manishearth:rollup, r=Manishearth
- Successful merges: #30821, #30869, #30871, #30874, #30879, #30886, #30892 - Failed merges: #30864
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/boxed.rs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 1afb49d9184..efc28be92a4 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -237,17 +237,17 @@ impl<T> Box<T> { } impl<T: ?Sized> Box<T> { - /// Constructs a box from the raw pointer. + /// Constructs a box from a raw pointer. /// - /// After this function call, pointer is owned by resulting box. - /// In particular, it means that `Box` destructor calls destructor - /// of `T` and releases memory. Since the way `Box` allocates and - /// releases memory is unspecified, the only valid pointer to pass - /// to this function is the one taken from another `Box` with - /// `Box::into_raw` function. + /// After calling this function, the raw pointer is owned by the + /// resulting `Box`. Specifically, the `Box` destructor will call + /// the destructor of `T` and free the allocated memory. Since the + /// way `Box` allocates and releases memory is unspecified, the + /// only valid pointer to pass to this function is the one taken + /// from another `Box` via the `Box::into_raw` function. /// - /// Function is unsafe, because improper use of this function may - /// lead to memory problems like double-free, for example if the + /// This function is unsafe because improper use may lead to + /// memory problems. For example, a double-free may occur if the /// function is called twice on the same raw pointer. #[stable(feature = "box_raw", since = "1.4.0")] #[inline] @@ -257,11 +257,11 @@ impl<T: ?Sized> Box<T> { /// Consumes the `Box`, returning the wrapped raw pointer. /// - /// After call to this function, caller is responsible for the memory - /// previously managed by `Box`, in particular caller should properly - /// destroy `T` and release memory. The proper way to do it is to - /// convert pointer back to `Box` with `Box::from_raw` function, because - /// `Box` does not specify, how memory is allocated. + /// After calling this function, the caller is responsible for the + /// memory previously managed by the `Box`. In particular, the + /// caller should properly destroy `T` and release the memory. The + /// proper way to do so is to convert the raw pointer back into a + /// `Box` with the `Box::from_raw` function. /// /// # Examples /// |
