Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions library/alloc/src/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
//!
//! Likewise, manually deallocating the raw pointer acquired from a `Box` is only sound
//! if the size of the pointee is non-zero, as zero-sized values may be represented by
//! a pointer that is not [*currently allocated*] by that allocator. It is recommended to
//! a pointer that did not come from that allocator. It is recommended to
//! pair [`Box::into_raw_with_allocator`] with [`Box::from_raw_in`], rather than
//! doing this.
//!
Expand Down Expand Up @@ -178,7 +178,6 @@
//! and it's best to avoid relying on this edition-dependent behavior if you wish to preserve
//! compatibility with future versions of the compiler.
//!
//! [*currently allocated*]: Allocator#currently-allocated-memory
//! [ucg#198]: https://github.com/rust-lang/unsafe-code-guidelines/issues/198
//! [ucg#326]: https://github.com/rust-lang/unsafe-code-guidelines/issues/326
//! [dereferencing]: core::ops::Deref
Expand Down
4 changes: 2 additions & 2 deletions library/alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
//! The parts of a [`Vec`] have the following invariants:
//!
//! * If [`size_of::<T>()`](size_of) and `cap` are non-zero, then:
//! - `ptr` must point to the start of a memory block [*currently allocated*] via `alloc`.
//! - `ptr` must point to the start of a memory block allocated with `alloc`; the vector takes
//! ownership of this memory block.
//! - [`Layout::array::<T>(cap)`] must [*fit*] the memory block of `ptr`. In particular,
//! * `T` must have the same alignment as the [`Layout`] `ptr` was allocated with, and
//! * `size_of::<T>() * cap` must be at least the size of the [`Layout`] `ptr` was
Expand Down Expand Up @@ -89,7 +90,6 @@
//! deallocating.
//!
//! [*fit*]: crate::alloc::Allocator#memory-fitting
//! [*currently allocated*]: crate::alloc::Allocator#currently-allocated-memory
//! [`allocate`]: crate::alloc::Allocator::allocate
//! [`push`]: Vec::push
//! [`ptr::NonNull::dangling`]: NonNull::dangling
Expand Down
Loading
Loading