Skip to main content

TypeInformationCtxt

Trait TypeInformationCtxt 

Source
pub trait TypeInformationCtxt<'tcx> {
    type TypeckResults<'a>: Deref<Target = TypeckResults<'tcx>>
       where Self: 'a;
    type Error;

    // Required methods
    fn typeck_results(&self) -> Self::TypeckResults<'_>;
    fn resolve_vars_if_possible<T: TypeFoldable<TyCtxt<'tcx>>>(&self, t: T) -> T;
    fn structurally_resolve_type(&self, span: Span, ty: Ty<'tcx>) -> Ty<'tcx>;
    fn report_bug(&self, span: Span, msg: impl ToString) -> Self::Error;
    fn error_reported_in_ty(&self, ty: Ty<'tcx>) -> Result<(), Self::Error>;
    fn tainted_by_errors(&self) -> Result<(), Self::Error>;
    fn type_is_copy_modulo_regions(&self, ty: Ty<'tcx>) -> bool;
    fn type_is_use_cloned_modulo_regions(&self, ty: Ty<'tcx>) -> bool;
    fn body_owner_def_id(&self) -> LocalDefId;
    fn tcx(&self) -> TyCtxt<'tcx>;
}
Expand description

This trait makes ExprUseVisitor usable with both FnCtxt and [LateContext], depending on where in the compiler it is used.

Required Associated Types§

Source

type TypeckResults<'a>: Deref<Target = TypeckResults<'tcx>> where Self: 'a

Source

type Error

Required Methods§

Source

fn typeck_results(&self) -> Self::TypeckResults<'_>

Source

fn resolve_vars_if_possible<T: TypeFoldable<TyCtxt<'tcx>>>(&self, t: T) -> T

Source

fn structurally_resolve_type(&self, span: Span, ty: Ty<'tcx>) -> Ty<'tcx>

Source

fn report_bug(&self, span: Span, msg: impl ToString) -> Self::Error

Source

fn error_reported_in_ty(&self, ty: Ty<'tcx>) -> Result<(), Self::Error>

Source

fn tainted_by_errors(&self) -> Result<(), Self::Error>

Source

fn type_is_copy_modulo_regions(&self, ty: Ty<'tcx>) -> bool

Source

fn type_is_use_cloned_modulo_regions(&self, ty: Ty<'tcx>) -> bool

Source

fn body_owner_def_id(&self) -> LocalDefId

Source

fn tcx(&self) -> TyCtxt<'tcx>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'tcx> TypeInformationCtxt<'tcx> for (&LateContext<'tcx>, LocalDefId)

Source§

type TypeckResults<'a> = &'tcx TypeckResults<'tcx> where Self: 'a

Source§

type Error = !

Source§

fn typeck_results(&self) -> Self::TypeckResults<'_>

Source§

fn structurally_resolve_type(&self, _span: Span, ty: Ty<'tcx>) -> Ty<'tcx>

Source§

fn resolve_vars_if_possible<T: TypeFoldable<TyCtxt<'tcx>>>(&self, t: T) -> T

Source§

fn report_bug(&self, span: Span, msg: impl ToString) -> !

Source§

fn error_reported_in_ty(&self, _ty: Ty<'tcx>) -> Result<(), !>

Source§

fn tainted_by_errors(&self) -> Result<(), !>

Source§

fn type_is_copy_modulo_regions(&self, ty: Ty<'tcx>) -> bool

Source§

fn type_is_use_cloned_modulo_regions(&self, ty: Ty<'tcx>) -> bool

Source§

fn body_owner_def_id(&self) -> LocalDefId

Source§

fn tcx(&self) -> TyCtxt<'tcx>

Implementors§

Source§

impl<'tcx> TypeInformationCtxt<'tcx> for &FnCtxt<'_, 'tcx>

Source§

type TypeckResults<'a> = Ref<'a, TypeckResults<'tcx>> where Self: 'a

Source§

type Error = ErrorGuaranteed