pub struct FnPtrShape(PolyFnSig<'static>);Expand description
Represents the “shape” of a function pointer, i.e. the most general signature we can obtain
from it without breaking the higher-kinded variables. E.g. for<'a> fn(&'a u32) -> Adt<'a, u32> is considered to be an instantiation of the shape for<'a> fn(&'a A) -> Adt<'a, B> with
A=B=u32.
It’s a PolyFnSig with erased 'tcx, to avoid threading that lifetime through hax::DefId.
The hax infrastructure never escapes the compiler session, so this should be fine.
Tuple Fields§
§0: PolyFnSig<'static>Implementations§
Source§impl FnPtrShape
impl FnPtrShape
Source§impl FnPtrShape
impl FnPtrShape
Sourcefn extract_shape<'tcx>(
tcx: TyCtxt<'tcx>,
sig: PolyFnSig<'tcx>,
) -> (Self, GenericArgsRef<'tcx>)
fn extract_shape<'tcx>( tcx: TyCtxt<'tcx>, sig: PolyFnSig<'tcx>, ) -> (Self, GenericArgsRef<'tcx>)
Replace each maximal type, region or constant that does not mention a locally-bound variable with a distinct generic parameter. We retain only the structure needed to keep higher-order variables correctly bound.
Trait Implementations§
Source§impl Clone for FnPtrShape
impl Clone for FnPtrShape
Source§fn clone(&self) -> FnPtrShape
fn clone(&self) -> FnPtrShape
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FnPtrShape
Source§impl Debug for FnPtrShape
impl Debug for FnPtrShape
impl Eq for FnPtrShape
Source§impl Hash for FnPtrShape
impl Hash for FnPtrShape
Source§impl PartialEq for FnPtrShape
impl PartialEq for FnPtrShape
impl RefUnwindSafe for FnPtrShape
impl StructuralPartialEq for FnPtrShape
impl UnwindSafe for FnPtrShape
Auto Trait Implementations§
impl DynSend for FnPtrShape
impl DynSync for FnPtrShape
impl Freeze for FnPtrShape
impl Send for FnPtrShape
impl Sync for FnPtrShape
impl Unpin for FnPtrShape
impl UnsafeUnpin for FnPtrShape
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Dedup for T
§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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key and return true if they are equal.impl<T> HashConsable for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
Converts
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> ⓘ
Converts
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