Enum hir::PointerCast
pub enum PointerCast {
ReifyFnPointer,
UnsafeFnPointer,
ClosureFnPointer(Safety),
MutToConstPointer,
ArrayToPointer,
Unsize,
}
Variants§
ReifyFnPointer
Go from a fn-item type to a fn-pointer type.
UnsafeFnPointer
Go from a safe fn pointer to an unsafe fn pointer.
ClosureFnPointer(Safety)
Go from a non-capturing closure to an fn pointer or an unsafe fn pointer. It cannot convert a closure that requires unsafe.
MutToConstPointer
Go from a mut raw pointer to a const raw pointer.
ArrayToPointer
Go from *const [T; N]
to *const T
Unsize
Unsize a pointer/reference value, e.g., &[T; n]
to
&[T]
. Note that the source could be a thin or fat pointer.
This will do things like convert thin pointers to fat
pointers, or convert structs containing thin pointers to
structs containing fat pointers, or convert between fat
pointers. We don’t store the details of how the transform is
done (in fact, we don’t know that, because it might depend on
the precise type parameters). We just store the target
type. Codegen backends and miri figure out what has to be done
based on the precise source/target type at hand.
Trait Implementations§
§impl Clone for PointerCast
impl Clone for PointerCast
§fn clone(&self) -> PointerCast
fn clone(&self) -> PointerCast
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for PointerCast
impl Debug for PointerCast
§impl Hash for PointerCast
impl Hash for PointerCast
§impl PartialEq for PointerCast
impl PartialEq for PointerCast
impl Copy for PointerCast
impl Eq for PointerCast
impl StructuralPartialEq for PointerCast
Auto Trait Implementations§
impl Freeze for PointerCast
impl RefUnwindSafe for PointerCast
impl Send for PointerCast
impl Sync for PointerCast
impl Unpin for PointerCast
impl UnwindSafe for PointerCast
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Cast for T
impl<T> Cast for T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more