Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
cynecx committed Feb 26, 2024
1 parent 42e5e0e commit c04f3d7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,13 @@ use {
///
/// See the [module-level documentation][crate::boxed] for more details.
#[repr(transparent)]
pub struct Box<'a, T: ?Sized> {
pub struct Box<'a, T: ?Sized>
where
// The `'static` bound is required for soundness, since `T` isn't actually owned by `Box`
// but instead owned by the bump allocator. A pinned `Box` is really just a handle and therefore
// `mem:forget`-ting a pinned Box will still cause a value drop when the arena drops.
T: 'static,
{
ptr: *mut T,
_marker: PhantomData<&'a mut T>,
}
Expand Down

0 comments on commit c04f3d7

Please sign in to comment.