pub(crate) struct UserTypeAnnotations {
annotations: IndexVec<UserTypeAnnotationIndex, UserTypeAnnotation>,
pub outlives: Vec<OutlivesPred>,
}Expand description
User-provided type annotations for this MIR body.
Fields§
§annotations: IndexVec<UserTypeAnnotationIndex, UserTypeAnnotation>§outlives: Vec<OutlivesPred>Implementations§
Source§impl UserTypeAnnotations
impl UserTypeAnnotations
Sourcepub(crate) fn new<'tcx>(
ctx: &mut ItemTransCtx<'tcx, '_>,
body: &Body<'tcx>,
) -> Result<Self, Error>
pub(crate) fn new<'tcx>( ctx: &mut ItemTransCtx<'tcx, '_>, body: &Body<'tcx>, ) -> Result<Self, Error>
Translate the annotations for this body. The returned value can then be used to fetch the types of annotations.
Sourcepub(crate) fn translate_local_ty<'tcx>(
&self,
ctx: &mut ItemTransCtx<'tcx, '_>,
span: Span,
local_id: LocalId,
decl: &LocalDecl<'tcx>,
) -> Result<(Ty, Vec<PlaceTypeConstraint>), Error>
pub(crate) fn translate_local_ty<'tcx>( &self, ctx: &mut ItemTransCtx<'tcx, '_>, span: Span, local_id: LocalId, decl: &LocalDecl<'tcx>, ) -> Result<(Ty, Vec<PlaceTypeConstraint>), Error>
Get the type of this local and the constraints from its type annotations.
Sourcepub(crate) fn translate_annotation(
&self,
index: UserTypeAnnotationIndex,
) -> Option<Ty>
pub(crate) fn translate_annotation( &self, index: UserTypeAnnotationIndex, ) -> Option<Ty>
Look up the (unprojected) type of an annotation.
Sourcepub(crate) fn translate_projected_annotation(
&self,
projection: &UserTypeProjection,
) -> Ty
pub(crate) fn translate_projected_annotation( &self, projection: &UserTypeProjection, ) -> Ty
Look up the type of an annotation.
Auto Trait Implementations§
impl !DynSend for UserTypeAnnotations
impl !DynSync for UserTypeAnnotations
impl Freeze for UserTypeAnnotations
impl RefUnwindSafe for UserTypeAnnotations
impl Send for UserTypeAnnotations
impl Sync for UserTypeAnnotations
impl Unpin for UserTypeAnnotations
impl UnsafeUnpin for UserTypeAnnotations
impl UnwindSafe for UserTypeAnnotations
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
§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