pub unsafe trait DerefPure { }๐ฌThis is a nightly-only experimental API. (
deref_pure_trait #87121)Expand description
Perma-unstable marker trait. Indicates that the type has a well-behaved Deref
(and, if applicable, DerefMut) implementation. This is relied on for soundness
of deref patterns.
FIXME(deref_patterns): The precise semantics are undecided; the rough idea is that
successive calls to deref/deref_mut without intermediate mutation should be
idempotent, in the sense that they return the same value as far as pattern-matching
is concerned. Calls to deref/deref_mut must leave the pointer itself likewise
unchanged.
Implementorsยง
impl DerefPure for Cow<'_, str>
impl DerefPure for ByteStr
impl DerefPure for ByteString
impl DerefPure for String
impl<Ptr> DerefPure for Pin<Ptr>where
Ptr: DerefPure,
impl<T> DerefPure for Cow<'_, [T]>where
T: Clone,
impl<T> DerefPure for Cow<'_, T>where
T: Clone,
impl<T> DerefPure for &Twhere
T: ?Sized,
impl<T> DerefPure for &mut Twhere
T: ?Sized,
impl<T> DerefPure for Ref<'_, T>where
T: ?Sized,
Available on non-crate feature
ferrocene_certified only.impl<T> DerefPure for RefMut<'_, T>where
T: ?Sized,
Available on non-crate feature
ferrocene_certified only.