/// It can be made from `T` with [`Ptr::new_heap()`],
/// or [`From<Box>`](#impl-From%3CBox%3CT%3E%3E-for-Ptr%3CT%3E).
///
-/// To access the contained data,
+/// To access the contained data use,
/// [`Ptr::borrow()`]
/// and
/// [`borrow_mut()`](Ptr::borrow_mut).
/// (or the only one which will be used).
///
/// All copies of `self` will be invalidated.
- ///
- /// So either no copies may exist any longer,
- /// or it is your responsibility to ensure
+ /// It is your responsibility to ensure
/// that none of them will be used.
+ /// ("used" means passed to any method in this library.)
///
- /// ("used" means passed to any method in this library).
- ///
- /// (The compiler will check that no borrows are live.)
+ /// The compiler will check that no borrows are live.
#[inline]
pub unsafe fn free_heap<'a>(self, tok: impl IsMutToken<'a>) {
let _t: Box<T> = unsafe { self.into_box(tok) };
///
/// The same rules as [`free_heap`](Ptr::free_heap) apply.
#[inline]
- pub unsafe fn from_heap<'a>(self, tok: impl IsMutToken<'a>) -> T
+ pub unsafe fn free_heap_return<'a>(self, tok: impl IsMutToken<'a>) -> T
where T: Sized
{
let t: Box<T> = unsafe { self.into_box(tok) };