Rollup merge of #90723 - asquared31415:box_docs, r=jyn514
Better document `Box` and `alloc::alloc::box_free` connection The internal `alloc::alloc::box_free` function requires that its signature matches the `owned_box` struct's declaration, but previously that connection was only documented on the `box_free` function. This PR makes the documentation two-way to help anyone making theoretical changes to `Box` to see the connection, since changes are more likely to originate from `Box`.
This commit is contained in:
commit
9c1aa12ff1
1 changed files with 3 additions and 0 deletions
|
@ -169,6 +169,9 @@ use crate::vec::Vec;
|
|||
#[lang = "owned_box"]
|
||||
#[fundamental]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
// The declaration of the `Box` struct must be kept in sync with the
|
||||
// `alloc::alloc::box_free` function or ICEs will happen. See the comment
|
||||
// on `box_free` for more details.
|
||||
pub struct Box<
|
||||
T: ?Sized,
|
||||
#[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global,
|
||||
|
|
Loading…
Add table
Reference in a new issue