pub(super) struct InferenceTyLoweringContext<'db, 'a> {
ctx: TyLoweringContext<'db, 'a>,
diagnostics: &'a Diagnostics,
source: InferenceTyDiagnosticSource,
defined_anon_consts: &'a RefCell<ThinVec<AnonConstId<'db>>>,
}Fields§
§ctx: TyLoweringContext<'db, 'a>§diagnostics: &'a Diagnostics§source: InferenceTyDiagnosticSource§defined_anon_consts: &'a RefCell<ThinVec<AnonConstId<'db>>>Implementations§
Source§impl<'db, 'a> InferenceTyLoweringContext<'db, 'a>
impl<'db, 'a> InferenceTyLoweringContext<'db, 'a>
pub(super) fn new( db: &'db dyn HirDatabase, resolver: &'a Resolver<'db>, store: &'db ExpressionStore, diagnostics: &'a Diagnostics, source: InferenceTyDiagnosticSource, def: ExpressionStoreOwnerId, generic_def: GenericDefId, generics: &'a OnceCell<Generics<'db>>, lifetime_elision: LifetimeElisionKind<'db>, allow_using_generic_params: bool, infer_vars: Option<&'a mut dyn TyLoweringInferVarsCtx<'db>>, defined_anon_consts: &'a RefCell<ThinVec<AnonConstId<'db>>>, lifetime_lowering_mode: LifetimeLoweringMode, ) -> Self
pub(super) fn at_path<'b>( &'b mut self, path: &'b Path, node: ExprOrPatIdPacked, ) -> PathLoweringContext<'b, 'a, 'db>
pub(super) fn at_path_forget_diagnostics<'b>( &'b mut self, path: &'b Path, ) -> PathLoweringContext<'b, 'a, 'db>
pub(super) fn forget_diagnostics(&mut self)
Methods from Deref<Target = TyLoweringContext<'db, 'a>>§
pub(crate) fn set_lifetime_elision( &mut self, lifetime_elision: LifetimeElisionKind<'db>, )
pub(crate) fn set_owner(&mut self, owner: &'a SingleGenerics<'db>)
pub(crate) fn with_debruijn<T>( &mut self, debruijn: DebruijnIndex, f: impl FnOnce(&mut TyLoweringContext<'db, '_>) -> T, ) -> T
pub(crate) fn with_shifted_in<T>( &mut self, binder: &[Name], f: impl FnOnce(&mut TyLoweringContext<'db, '_>) -> T, ) -> (T, BoundVarKinds<'db>)
pub(crate) fn impl_trait_mode( &mut self, impl_trait_mode: ImplTraitLoweringMode, ) -> &mut Self
pub(crate) fn forbid_params_after( &mut self, index: u32, reason: ForbidParamsAfterReason, )
pub(crate) fn push_diagnostic(&mut self, diagnostic: TyLoweringDiagnostic)
fn push_infer_vars_not_allowed(&mut self, span: Span)
pub(crate) fn expect_table(&mut self) -> &mut InferenceTable<'db>
fn next_ty_var(&mut self, span: Span) -> Ty<'db>
fn next_const_var(&mut self, span: Span) -> Const<'db>
fn next_region_var(&mut self, span: Span) -> Region<'db>
fn push_bound_vars(&mut self, binder: &[Name])
fn pop_bound_vars(&mut self) -> BoundVarKinds<'db>
fn peek_bound_vars(&self) -> BoundVarKinds<'db>
pub fn lower_ty(&mut self, type_ref: TypeRefId) -> Ty<'db>
pub(crate) fn lower_const( &mut self, const_ref: ConstRef, const_type: Ty<'db>, ) -> Const<'db>
pub(crate) fn lower_expr_as_const( &mut self, expr_id: ExprId, const_type: Ty<'db>, ) -> Const<'db>
pub(crate) fn lower_path_as_const( &mut self, path: &Path, _const_type: Ty<'db>, ) -> Const<'db>
fn generics(&self) -> &Generics<'db>
fn param_index_is_disallowed(&self, index: u32) -> bool
fn type_param(&mut self, id: TypeParamId, index: u32) -> Ty<'db>
fn region_param( &mut self, id: LifetimeParamId, index: u32, is_late_bound: bool, ) -> Region<'db>
fn hrtb_region_param( &self, index: u32, debruijn: DebruijnIndex, parent: GenericDefId, ) -> Region<'db>
pub fn lower_ty_ext( &mut self, type_ref_id: TypeRefId, ) -> (Ty<'db>, Option<TypeNs>)
fn lower_pattern_type( &mut self, pat: PatId, ty: Ty<'db>, ) -> Option<Pattern<'db>>
fn lower_fn_ptr(&mut self, fn_: &FnType) -> Ty<'db>
Sourcefn lower_ty_only_param(&self, type_ref: TypeRefId) -> Option<TypeOrConstParamId>
fn lower_ty_only_param(&self, type_ref: TypeRefId) -> Option<TypeOrConstParamId>
This is only for generic_predicates_for_param, where we can’t just
lower the self types of the predicates since that could lead to cycles.
So we just check here if the type_ref resolves to a generic param, and which.
fn at_path(&mut self, path_id: PathId) -> PathLoweringContext<'_, 'a, 'db>
pub(crate) fn lower_path( &mut self, path: &Path, path_id: PathId, ) -> (Ty<'db>, Option<TypeNs>)
fn lower_trait_ref_from_path( &mut self, path_id: PathId, explicit_self_ty: Ty<'db>, ) -> Option<(TraitRef<'db>, PathLoweringContext<'_, 'a, 'db>)>
fn lower_trait_ref( &mut self, trait_ref: &HirTraitRef, explicit_self_ty: Ty<'db>, ) -> Option<TraitRef<'db>>
pub(crate) fn lower_where_predicate<'b>( &'b mut self, where_predicate: &'b WherePredicate, ignore_bindings: bool, ) -> impl Iterator<Item = (Clause<'db>, GenericPredicateSource)> + use<'a, 'b, 'db>
pub(crate) fn lower_type_bound<'b>( &'b mut self, bound: &'b TypeBound, self_ty: Ty<'db>, ignore_bindings: bool, ) -> impl Iterator<Item = (Clause<'db>, GenericPredicateSource)> + use<'b, 'a, 'db>
fn lower_dyn_trait(&mut self, bounds: &[TypeBound]) -> Ty<'db>
fn lower_impl_trait( &mut self, def_id: InternedOpaqueTyId<'db>, bounds: &[TypeBound], ) -> ImplTrait
pub(crate) fn lower_lifetime(&mut self, lifetime: LifetimeRefId) -> Region<'db>
fn find_and_lower_hrtb_lifetime( &mut self, lifetime: LifetimeRefId, ) -> Option<Region<'db>>
Trait Implementations§
Source§impl<'db, 'a> Deref for InferenceTyLoweringContext<'db, 'a>
impl<'db, 'a> Deref for InferenceTyLoweringContext<'db, 'a>
Source§impl DerefMut for InferenceTyLoweringContext<'_, '_>
impl DerefMut for InferenceTyLoweringContext<'_, '_>
Source§impl Drop for InferenceTyLoweringContext<'_, '_>
impl Drop for InferenceTyLoweringContext<'_, '_>
Auto Trait Implementations§
impl<'db, 'a> Freeze for InferenceTyLoweringContext<'db, 'a>
impl<'db, 'a> !RefUnwindSafe for InferenceTyLoweringContext<'db, 'a>
impl<'db, 'a> !Send for InferenceTyLoweringContext<'db, 'a>
impl<'db, 'a> !Sync for InferenceTyLoweringContext<'db, 'a>
impl<'db, 'a> Unpin for InferenceTyLoweringContext<'db, 'a>
impl<'db, 'a> UnsafeUnpin for InferenceTyLoweringContext<'db, 'a>
impl<'db, 'a> !UnwindSafe for InferenceTyLoweringContext<'db, '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, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> 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>
§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