diff options
| author | LemonJ <1632798336@qq.com> | 2025-01-02 11:12:31 +0800 |
|---|---|---|
| committer | LemonJ <1632798336@qq.com> | 2025-01-02 11:12:31 +0800 |
| commit | a5494a8e6cc9796b7e0ccd0838ae74509203c8a2 (patch) | |
| tree | 0a5d67f7a283d03146d430515fbde71b54908241 | |
| parent | 62b13a9019a8b0a7a41039eb66bb44dc66b938c3 (diff) | |
| download | rust-a5494a8e6cc9796b7e0ccd0838ae74509203c8a2.tar.gz rust-a5494a8e6cc9796b7e0ccd0838ae74509203c8a2.zip | |
fix doc for missing Box allocator consistency
| -rw-r--r-- | library/alloc/src/boxed.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs index ca3bd24a420..05e5d712a27 100644 --- a/library/alloc/src/boxed.rs +++ b/library/alloc/src/boxed.rs @@ -1045,6 +1045,8 @@ impl<T: ?Sized> Box<T> { /// memory problems. For example, a double-free may occur if the /// function is called twice on the same raw pointer. /// + /// The raw pointer must point to a block of memory allocated by the global allocator. + /// /// The safety conditions are described in the [memory layout] section. /// /// # Examples @@ -1148,6 +1150,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> { /// memory problems. For example, a double-free may occur if the /// function is called twice on the same raw pointer. /// + /// The raw pointer must point to a block of memory allocated by `alloc` /// /// # Examples /// |
