Closed as not planned
Description
WARNING: This might be unsound per #1866.
This builds on machinery introduced in #1166.
It would be nice to introduce a general invariant relaxation method in the form:
fn relax_invariants<J>(self) -> Ptr<'a, T, J>
where
I: invariants::AtLeast<J>,
{
// SAFETY: `I` is at least as restrictive as `J`.
unsafe { Ptr::from_ptr(self) }
}
...and call it in our specific .forget_*
methods.
We think this might be blocked on stabilizing feature(marker_trait_attr)
(rust-lang/rust#29864).
Metadata
Metadata
Assignees
Labels
No labels