Struct hir_ty::TyLoweringContext
source · pub struct TyLoweringContext<'a> {
pub db: &'a dyn HirDatabase,
pub type_param_mode: ParamLoweringMode,
/* private fields */
}
Fields§
§db: &'a dyn HirDatabase
§type_param_mode: ParamLoweringMode
Note: Conceptually, it’s thinkable that we could be in a location where some type params should be represented as placeholders, and others should be converted to variables. I think in practice, this isn’t possible currently, so this should be fine for now.
Implementations§
source§impl<'a> TyLoweringContext<'a>
impl<'a> TyLoweringContext<'a>
pub fn new( db: &'a dyn HirDatabase, resolver: &'a Resolver, types_map: &'a TypesMap, owner: TypeOwnerId, ) -> Self
pub fn new_maybe_unowned( db: &'a dyn HirDatabase, resolver: &'a Resolver, types_map: &'a TypesMap, types_source_map: Option<&'a TypesSourceMap>, owner: Option<TypeOwnerId>, ) -> Self
pub fn with_debruijn<T>( &mut self, debruijn: DebruijnIndex, f: impl FnOnce(&mut TyLoweringContext<'_>) -> T, ) -> T
pub fn with_shifted_in<T>( &mut self, debruijn: DebruijnIndex, f: impl FnOnce(&mut TyLoweringContext<'_>) -> T, ) -> T
pub fn with_impl_trait_mode( self, impl_trait_mode: ImplTraitLoweringMode, ) -> Self
pub fn with_type_param_mode(self, type_param_mode: ParamLoweringMode) -> Self
pub fn impl_trait_mode( &mut self, impl_trait_mode: ImplTraitLoweringMode, ) -> &mut Self
pub fn type_param_mode( &mut self, type_param_mode: ParamLoweringMode, ) -> &mut Self
source§impl<'a> TyLoweringContext<'a>
impl<'a> TyLoweringContext<'a>
pub fn lower_ty(&mut self, type_ref: TypeRefId) -> Ty
pub fn lower_const(&mut self, const_ref: &ConstRef, const_type: Ty) -> Const
pub fn lower_ty_ext(&mut self, type_ref_id: TypeRefId) -> (Ty, Option<TypeNs>)
pub fn lower_lifetime(&self, lifetime: &LifetimeRef) -> Lifetime
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Freeze for TyLoweringContext<'a>
impl<'a> !RefUnwindSafe for TyLoweringContext<'a>
impl<'a> !Send for TyLoweringContext<'a>
impl<'a> !Sync for TyLoweringContext<'a>
impl<'a> Unpin for TyLoweringContext<'a>
impl<'a> !UnwindSafe for TyLoweringContext<'a>
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>
§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>
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