Trait HirDatabase

Source
pub trait HirDatabase:
    DefDatabase
    + Upcast<dyn DefDatabase>
    + Debug {
Show 67 methods // Required methods fn infer(&self, def: DefWithBodyId) -> Arc<InferenceResult>; fn mir_body( &self, def: DefWithBodyId, ) -> Result<Arc<MirBody>, MirLowerError>; fn mir_body_for_closure( &self, def: InternedClosureId, ) -> Result<Arc<MirBody>, MirLowerError>; fn monomorphized_mir_body( &self, def: DefWithBodyId, subst: Substitution, env: Arc<TraitEnvironment>, ) -> Result<Arc<MirBody>, MirLowerError>; fn monomorphized_mir_body_for_closure( &self, def: InternedClosureId, subst: Substitution, env: Arc<TraitEnvironment>, ) -> Result<Arc<MirBody>, MirLowerError>; fn borrowck( &self, def: DefWithBodyId, ) -> Result<Arc<[BorrowckResult]>, MirLowerError>; fn const_eval( &self, def: GeneralConstId, subst: Substitution, trait_env: Option<Arc<TraitEnvironment>>, ) -> Result<Const, ConstEvalError>; fn const_eval_static(&self, def: StaticId) -> Result<Const, ConstEvalError>; fn const_eval_discriminant( &self, def: EnumVariantId, ) -> Result<i128, ConstEvalError>; fn lookup_impl_method( &self, env: Arc<TraitEnvironment>, func: FunctionId, fn_subst: Substitution, ) -> (FunctionId, Substitution); fn layout_of_adt( &self, def: AdtId, subst: Substitution, env: Arc<TraitEnvironment>, ) -> Result<Arc<Layout>, LayoutError>; fn layout_of_ty( &self, ty: Ty, env: Arc<TraitEnvironment>, ) -> Result<Arc<Layout>, LayoutError>; fn target_data_layout( &self, krate: Crate, ) -> Result<Arc<TargetDataLayout>, Arc<str>>; fn dyn_compatibility_of_trait( &self, trait_: TraitId, ) -> Option<DynCompatibilityViolation>; fn ty(&self, def: TyDefId) -> Binders<Ty>; fn type_for_type_alias_with_diagnostics( &self, def: TypeAliasId, ) -> (Binders<Ty>, Option<ThinArc<(), TyLoweringDiagnostic>>); fn value_ty(&self, def: ValueTyDefId) -> Option<Binders<Ty>>; fn impl_self_ty_with_diagnostics( &self, def: ImplId, ) -> (Binders<Ty>, Option<ThinArc<(), TyLoweringDiagnostic>>); fn impl_self_ty(&self, def: ImplId) -> Binders<Ty>; fn const_param_ty_with_diagnostics( &self, def: ConstParamId, ) -> (Ty, Option<ThinArc<(), TyLoweringDiagnostic>>); fn const_param_ty(&self, def: ConstParamId) -> Ty; fn impl_trait_with_diagnostics( &self, def: ImplId, ) -> Option<(Binders<TraitRef>, Option<ThinArc<(), TyLoweringDiagnostic>>)>; fn impl_trait(&self, def: ImplId) -> Option<Binders<TraitRef>>; fn field_types_with_diagnostics( &self, var: VariantId, ) -> (Arc<ArenaMap<LocalFieldId, Binders<Ty>>>, Option<ThinArc<(), TyLoweringDiagnostic>>); fn field_types( &self, var: VariantId, ) -> Arc<ArenaMap<LocalFieldId, Binders<Ty>>>; fn callable_item_signature(&self, def: CallableDefId) -> PolyFnSig; fn return_type_impl_traits( &self, def: FunctionId, ) -> Option<Arc<Binders<ImplTraits>>>; fn type_alias_impl_traits( &self, def: TypeAliasId, ) -> Option<Arc<Binders<ImplTraits>>>; fn generic_predicates_for_param( &self, def: GenericDefId, param_id: TypeOrConstParamId, assoc_name: Option<Name>, ) -> GenericPredicates; fn generic_predicates(&self, def: GenericDefId) -> GenericPredicates; fn generic_predicates_without_parent_with_diagnostics( &self, def: GenericDefId, ) -> (GenericPredicates, Option<ThinArc<(), TyLoweringDiagnostic>>); fn generic_predicates_without_parent( &self, def: GenericDefId, ) -> GenericPredicates; fn trait_environment_for_body( &self, def: DefWithBodyId, ) -> Arc<TraitEnvironment>; fn trait_environment(&self, def: GenericDefId) -> Arc<TraitEnvironment>; fn generic_defaults_with_diagnostics( &self, def: GenericDefId, ) -> (GenericDefaults, Option<ThinArc<(), TyLoweringDiagnostic>>); fn generic_defaults(&self, def: GenericDefId) -> GenericDefaults; fn inherent_impls_in_crate(&self, krate: Crate) -> Arc<InherentImpls>; fn inherent_impls_in_block( &self, block: BlockId, ) -> Option<Arc<InherentImpls>>; fn incoherent_inherent_impl_crates( &self, krate: Crate, fp: TyFingerprint, ) -> SmallVec<[Crate; 2]>; fn trait_impls_in_crate(&self, krate: Crate) -> Arc<TraitImpls>; fn trait_impls_in_block(&self, block: BlockId) -> Option<Arc<TraitImpls>>; fn trait_impls_in_deps(&self, krate: Crate) -> Arc<[Arc<TraitImpls>]>; fn intern_callable_def( &self, callable_def: CallableDefId, ) -> InternedCallableDefId; fn intern_type_or_const_param_id( &self, param_id: TypeOrConstParamId, ) -> InternedTypeOrConstParamId; fn intern_lifetime_param_id( &self, param_id: LifetimeParamId, ) -> InternedLifetimeParamId; fn intern_impl_trait_id(&self, id: ImplTraitId) -> InternedOpaqueTyId; fn intern_closure(&self, id: InternedClosure) -> InternedClosureId; fn intern_coroutine(&self, id: InternedCoroutine) -> InternedCoroutineId; fn associated_ty_data( &self, id: TypeAliasId, ) -> Arc<AssociatedTyDatum<Interner>>; fn trait_datum( &self, krate: Crate, trait_id: TraitId<Interner>, ) -> Arc<TraitDatum<Interner>>; fn adt_datum( &self, krate: Crate, struct_id: AdtId<Interner>, ) -> Arc<AdtDatum<Interner>>; fn impl_datum( &self, krate: Crate, impl_id: ImplId<Interner>, ) -> Arc<ImplDatum<Interner>>; fn fn_def_datum( &self, fn_def_id: CallableDefId, ) -> Arc<FnDefDatum<Interner>>; fn fn_def_variance(&self, fn_def_id: CallableDefId) -> Variances<Interner>; fn adt_variance(&self, adt_id: AdtId) -> Variances<Interner>; fn variances_of(&self, def: GenericDefId) -> Option<Arc<[Variance]>>; fn associated_ty_value( &self, krate: Crate, id: AssociatedTyValueId<Interner>, ) -> Arc<AssociatedTyValue<Interner>>; fn normalize_projection( &self, projection: ProjectionTy, env: Arc<TraitEnvironment>, ) -> Ty; fn trait_solve( &self, krate: Crate, block: Option<BlockId>, goal: Canonical<InEnvironment<Goal>>, ) -> Option<Solution>; fn program_clauses_for_chalk_env( &self, krate: Crate, block: Option<BlockId>, env: Environment<Interner>, ) -> ProgramClauses<Interner>; fn has_drop_glue(&self, ty: Ty, env: Arc<TraitEnvironment>) -> DropGlue; fn lookup_intern_callable_def( &self, id: InternedCallableDefId, ) -> CallableDefId; fn lookup_intern_type_or_const_param_id( &self, id: InternedTypeOrConstParamId, ) -> TypeOrConstParamId; fn lookup_intern_lifetime_param_id( &self, id: InternedLifetimeParamId, ) -> LifetimeParamId; fn lookup_intern_impl_trait_id(&self, id: InternedOpaqueTyId) -> ImplTraitId; fn lookup_intern_closure(&self, id: InternedClosureId) -> InternedClosure; fn lookup_intern_coroutine( &self, id: InternedCoroutineId, ) -> InternedCoroutine;
}

Required Methods§

Source

fn infer(&self, def: DefWithBodyId) -> Arc<InferenceResult>

Source

fn mir_body(&self, def: DefWithBodyId) -> Result<Arc<MirBody>, MirLowerError>

Source

fn mir_body_for_closure( &self, def: InternedClosureId, ) -> Result<Arc<MirBody>, MirLowerError>

Source

fn monomorphized_mir_body( &self, def: DefWithBodyId, subst: Substitution, env: Arc<TraitEnvironment>, ) -> Result<Arc<MirBody>, MirLowerError>

Source

fn monomorphized_mir_body_for_closure( &self, def: InternedClosureId, subst: Substitution, env: Arc<TraitEnvironment>, ) -> Result<Arc<MirBody>, MirLowerError>

Source

fn borrowck( &self, def: DefWithBodyId, ) -> Result<Arc<[BorrowckResult]>, MirLowerError>

Source

fn const_eval( &self, def: GeneralConstId, subst: Substitution, trait_env: Option<Arc<TraitEnvironment>>, ) -> Result<Const, ConstEvalError>

Source

fn const_eval_static(&self, def: StaticId) -> Result<Const, ConstEvalError>

Source

fn const_eval_discriminant( &self, def: EnumVariantId, ) -> Result<i128, ConstEvalError>

Source

fn lookup_impl_method( &self, env: Arc<TraitEnvironment>, func: FunctionId, fn_subst: Substitution, ) -> (FunctionId, Substitution)

Source

fn layout_of_adt( &self, def: AdtId, subst: Substitution, env: Arc<TraitEnvironment>, ) -> Result<Arc<Layout>, LayoutError>

Source

fn layout_of_ty( &self, ty: Ty, env: Arc<TraitEnvironment>, ) -> Result<Arc<Layout>, LayoutError>

Source

fn target_data_layout( &self, krate: Crate, ) -> Result<Arc<TargetDataLayout>, Arc<str>>

Source

fn dyn_compatibility_of_trait( &self, trait_: TraitId, ) -> Option<DynCompatibilityViolation>

Source

fn ty(&self, def: TyDefId) -> Binders<Ty>

Source

fn type_for_type_alias_with_diagnostics( &self, def: TypeAliasId, ) -> (Binders<Ty>, Option<ThinArc<(), TyLoweringDiagnostic>>)

Source

fn value_ty(&self, def: ValueTyDefId) -> Option<Binders<Ty>>

Source

fn impl_self_ty_with_diagnostics( &self, def: ImplId, ) -> (Binders<Ty>, Option<ThinArc<(), TyLoweringDiagnostic>>)

Source

fn impl_self_ty(&self, def: ImplId) -> Binders<Ty>

Source

fn const_param_ty_with_diagnostics( &self, def: ConstParamId, ) -> (Ty, Option<ThinArc<(), TyLoweringDiagnostic>>)

Source

fn const_param_ty(&self, def: ConstParamId) -> Ty

Source

fn impl_trait_with_diagnostics( &self, def: ImplId, ) -> Option<(Binders<TraitRef>, Option<ThinArc<(), TyLoweringDiagnostic>>)>

Source

fn impl_trait(&self, def: ImplId) -> Option<Binders<TraitRef>>

Source

fn field_types_with_diagnostics( &self, var: VariantId, ) -> (Arc<ArenaMap<LocalFieldId, Binders<Ty>>>, Option<ThinArc<(), TyLoweringDiagnostic>>)

Source

fn field_types( &self, var: VariantId, ) -> Arc<ArenaMap<LocalFieldId, Binders<Ty>>>

Source

fn callable_item_signature(&self, def: CallableDefId) -> PolyFnSig

Source

fn return_type_impl_traits( &self, def: FunctionId, ) -> Option<Arc<Binders<ImplTraits>>>

Source

fn type_alias_impl_traits( &self, def: TypeAliasId, ) -> Option<Arc<Binders<ImplTraits>>>

Source

fn generic_predicates_for_param( &self, def: GenericDefId, param_id: TypeOrConstParamId, assoc_name: Option<Name>, ) -> GenericPredicates

Source

fn generic_predicates(&self, def: GenericDefId) -> GenericPredicates

Source

fn generic_predicates_without_parent_with_diagnostics( &self, def: GenericDefId, ) -> (GenericPredicates, Option<ThinArc<(), TyLoweringDiagnostic>>)

Source

fn generic_predicates_without_parent( &self, def: GenericDefId, ) -> GenericPredicates

Source

fn trait_environment_for_body( &self, def: DefWithBodyId, ) -> Arc<TraitEnvironment>

Source

fn trait_environment(&self, def: GenericDefId) -> Arc<TraitEnvironment>

Source

fn generic_defaults_with_diagnostics( &self, def: GenericDefId, ) -> (GenericDefaults, Option<ThinArc<(), TyLoweringDiagnostic>>)

Source

fn generic_defaults(&self, def: GenericDefId) -> GenericDefaults

Source

fn inherent_impls_in_crate(&self, krate: Crate) -> Arc<InherentImpls>

Source

fn inherent_impls_in_block(&self, block: BlockId) -> Option<Arc<InherentImpls>>

Source

fn incoherent_inherent_impl_crates( &self, krate: Crate, fp: TyFingerprint, ) -> SmallVec<[Crate; 2]>

Source

fn trait_impls_in_crate(&self, krate: Crate) -> Arc<TraitImpls>

Source

fn trait_impls_in_block(&self, block: BlockId) -> Option<Arc<TraitImpls>>

Source

fn trait_impls_in_deps(&self, krate: Crate) -> Arc<[Arc<TraitImpls>]>

Source

fn intern_callable_def( &self, callable_def: CallableDefId, ) -> InternedCallableDefId

Source

fn intern_type_or_const_param_id( &self, param_id: TypeOrConstParamId, ) -> InternedTypeOrConstParamId

Source

fn intern_lifetime_param_id( &self, param_id: LifetimeParamId, ) -> InternedLifetimeParamId

Source

fn intern_impl_trait_id(&self, id: ImplTraitId) -> InternedOpaqueTyId

Source

fn intern_closure(&self, id: InternedClosure) -> InternedClosureId

Source

fn intern_coroutine(&self, id: InternedCoroutine) -> InternedCoroutineId

Source

fn associated_ty_data( &self, id: TypeAliasId, ) -> Arc<AssociatedTyDatum<Interner>>

Source

fn trait_datum( &self, krate: Crate, trait_id: TraitId<Interner>, ) -> Arc<TraitDatum<Interner>>

Source

fn adt_datum( &self, krate: Crate, struct_id: AdtId<Interner>, ) -> Arc<AdtDatum<Interner>>

Source

fn impl_datum( &self, krate: Crate, impl_id: ImplId<Interner>, ) -> Arc<ImplDatum<Interner>>

Source

fn fn_def_datum(&self, fn_def_id: CallableDefId) -> Arc<FnDefDatum<Interner>>

Source

fn fn_def_variance(&self, fn_def_id: CallableDefId) -> Variances<Interner>

Source

fn adt_variance(&self, adt_id: AdtId) -> Variances<Interner>

Source

fn variances_of(&self, def: GenericDefId) -> Option<Arc<[Variance]>>

Source

fn associated_ty_value( &self, krate: Crate, id: AssociatedTyValueId<Interner>, ) -> Arc<AssociatedTyValue<Interner>>

Source

fn normalize_projection( &self, projection: ProjectionTy, env: Arc<TraitEnvironment>, ) -> Ty

Source

fn trait_solve( &self, krate: Crate, block: Option<BlockId>, goal: Canonical<InEnvironment<Goal>>, ) -> Option<Solution>

Source

fn program_clauses_for_chalk_env( &self, krate: Crate, block: Option<BlockId>, env: Environment<Interner>, ) -> ProgramClauses<Interner>

Source

fn has_drop_glue(&self, ty: Ty, env: Arc<TraitEnvironment>) -> DropGlue

Source

fn lookup_intern_callable_def(&self, id: InternedCallableDefId) -> CallableDefId

Source

fn lookup_intern_type_or_const_param_id( &self, id: InternedTypeOrConstParamId, ) -> TypeOrConstParamId

Source

fn lookup_intern_lifetime_param_id( &self, id: InternedLifetimeParamId, ) -> LifetimeParamId

Source

fn lookup_intern_impl_trait_id(&self, id: InternedOpaqueTyId) -> ImplTraitId

Source

fn lookup_intern_closure(&self, id: InternedClosureId) -> InternedClosure

Source

fn lookup_intern_coroutine(&self, id: InternedCoroutineId) -> InternedCoroutine

Trait Implementations§

Source§

impl UnificationDatabase<Interner> for &dyn HirDatabase

Source§

fn fn_def_variance(&self, fn_def_id: FnDefId<Interner>) -> Variances<Interner>

Gets the variances for the substitution of a fn def
Source§

fn adt_variance(&self, adt_id: AdtId<Interner>) -> Variances<Interner>

Gets the variances for the substitution of a adt

Implementors§

Source§

impl<DB> HirDatabase for DB
where DB: DefDatabase + Upcast<dyn DefDatabase> + Debug,