Enum stable_mir::mir::body::PointerCoercion
source · pub enum PointerCoercion {
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 a 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.
Trait Implementations§
source§impl Clone for PointerCoercion
impl Clone for PointerCoercion
source§fn clone(&self) -> PointerCoercion
fn clone(&self) -> PointerCoercion
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PointerCoercion
impl Debug for PointerCoercion
source§impl PartialEq for PointerCoercion
impl PartialEq for PointerCoercion
source§fn eq(&self, other: &PointerCoercion) -> bool
fn eq(&self, other: &PointerCoercion) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for PointerCoercion
impl Eq for PointerCoercion
impl StructuralPartialEq for PointerCoercion
Auto Trait Implementations§
impl Freeze for PointerCoercion
impl RefUnwindSafe for PointerCoercion
impl Send for PointerCoercion
impl Sync for PointerCoercion
impl Unpin for PointerCoercion
impl UnwindSafe for PointerCoercion
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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte
Size for each variant:
ReifyFnPointer
: 0 bytesUnsafeFnPointer
: 0 bytesClosureFnPointer
: 1 byteMutToConstPointer
: 0 bytesArrayToPointer
: 0 bytesUnsize
: 0 bytes