};
t
}
-
-/*
- /// SAFETY
- ///
- /// All copies of the returned `Ptr` become invalid
- /// when the borrow of `t` ends.
- /// No-one must use them after that.
- ///
- /// You must not call `deallocate` on the return value.
-TODO lifetime is hard
- pub unsafe fn new_borrowed<'t>(t: Pin<&'t mut T>) -> Self { todo!() }
-*/
}
impl NoAliasSingleton {
pub unsafe fn init() -> Self { NoAliasSingleton {} }
}
+/*
+ /// SAFETY
+ ///
+ /// All copies of the returned `Ptr` become invalid
+ /// when the borrow of `t` ends.
+ /// No-one must use them after that.
+ ///
+ /// You must not call `deallocate` on the return value.
+TODO lifetime is hard
+ pub unsafe fn new_borrowed<'t>(t: Pin<&'t mut T>) -> Self { todo!() }
+*/
+
//---------- helpful impls ----------
impl<T: ?Sized> From<Box<T>> for Ptr<T> {