pub struct EmptyTyDefDb;Expand description
Zero-state TyDefDb when running pure local CST inference without an external .ridx index.
Trait Implementations§
Source§impl Clone for EmptyTyDefDb
impl Clone for EmptyTyDefDb
impl Copy for EmptyTyDefDb
Source§impl Debug for EmptyTyDefDb
impl Debug for EmptyTyDefDb
Source§impl Default for EmptyTyDefDb
impl Default for EmptyTyDefDb
Source§impl TyDefDb for EmptyTyDefDb
impl TyDefDb for EmptyTyDefDb
Source§fn fn_sig(
&self,
_: GlobalDefId,
_: &mut InferTyArena,
_: &mut Vec<InferTyId>,
) -> Option<(u16, InferTyId)>
fn fn_sig( &self, _: GlobalDefId, _: &mut InferTyArena, _: &mut Vec<InferTyId>, ) -> Option<(u16, InferTyId)>
Function or associated function signature: appends parameter types to
inputs_out and returns
(generic_type_or_const_param_count, output_ty).Source§fn def_ty(
&self,
_: GlobalDefId,
_: &mut InferTyArena,
) -> Option<(u16, CtorShapeKind, InferTyId)>
fn def_ty( &self, _: GlobalDefId, _: &mut InferTyArena, ) -> Option<(u16, CtorShapeKind, InferTyId)>
Definition type for an ADT (
Struct/Enum/Union), Variant (returns owning Enum ADT type),
TypeAlias (returns aliased target type), Const, or Static, along with (generic_count, ctor_shape).Source§fn ctor_tuple_fields(
&self,
_: GlobalDefId,
_: &mut InferTyArena,
_: &mut Vec<InferTyId>,
) -> Option<u16>
fn ctor_tuple_fields( &self, _: GlobalDefId, _: &mut InferTyArena, _: &mut Vec<InferTyId>, ) -> Option<u16>
Tuple constructor field types for a tuple
Struct or tuple Variant; returns generic_count.Source§fn field_ty(
&self,
_: GlobalDefId,
_: &str,
_: &mut InferTyArena,
) -> Option<(u16, InferTyId)>
fn field_ty( &self, _: GlobalDefId, _: &str, _: &mut InferTyArena, ) -> Option<(u16, InferTyId)>
Field type by name (or
"0", "1" for tuple fields) on a Struct, Union, or Variant,
returning (generic_count, field_ty) parameterized by Param { idx, .. }.Source§fn lang_item(&self, _: TyLangItem) -> Option<GlobalDefId>
fn lang_item(&self, _: TyLangItem) -> Option<GlobalDefId>
Resolves a known compiler
TyLangItem to its GlobalDefId.Source§fn lang_item_of_def(&self, _: GlobalDefId) -> Option<TyLangItem>
fn lang_item_of_def(&self, _: GlobalDefId) -> Option<TyLangItem>
Source§fn project_assoc_ty(
&self,
_: TyLangItem,
_: InferTyId,
_: &[InferTyId],
_: &mut InferTyArena,
_: &mut UnionFindTable,
) -> Option<InferTyId>
fn project_assoc_ty( &self, _: TyLangItem, _: InferTyId, _: &[InferTyId], _: &mut InferTyArena, _: &mut UnionFindTable, ) -> Option<InferTyId>
Projects an associated type (
TryOutput, FutureOutput, IntoFutureOutput, DerefTarget,
IndexOutput, IntoIteratorItem, IteratorItem, or operator Output) for self_ty and trait_args.Source§fn param_fn_bound(
&self,
_: GlobalDefId,
_: u16,
_: &mut InferTyArena,
_: &mut Vec<InferTyId>,
) -> Option<(TyLangItem, InferTyId)>
fn param_fn_bound( &self, _: GlobalDefId, _: u16, _: &mut InferTyArena, _: &mut Vec<InferTyId>, ) -> Option<(TyLangItem, InferTyId)>
Queries an
Fn* / AsyncFn* trait bound on generic parameter param_idx of owner_def,
appending expected closure parameter types (containing Param { idx, .. }) to inputs_out
and returning (fn_trait_item, ret_ty).Source§fn field_ty_and_def(
&self,
owner_def: GlobalDefId,
name: &str,
arena: &mut InferTyArena,
) -> Option<(u16, InferTyId, GlobalDefId)>
fn field_ty_and_def( &self, owner_def: GlobalDefId, name: &str, arena: &mut InferTyArena, ) -> Option<(u16, InferTyId, GlobalDefId)>
Field type + field
GlobalDefId by name (or "0", "1" for tuple fields).Source§fn project_trait_assoc(
&self,
_trait_def: GlobalDefId,
_assoc_def: GlobalDefId,
_self_ty: InferTyId,
_trait_args: &[InferTyId],
_arena: &mut InferTyArena,
_vars: &mut UnionFindTable,
) -> Option<InferTyId>
fn project_trait_assoc( &self, _trait_def: GlobalDefId, _assoc_def: GlobalDefId, _self_ty: InferTyId, _trait_args: &[InferTyId], _arena: &mut InferTyArena, _vars: &mut UnionFindTable, ) -> Option<InferTyId>
Projects an arbitrary trait associated type
<self_ty as trait_def<trait_args>>::assoc_def.Source§fn inherent_method_cands(
&self,
_target: ImplTargetKey,
_method_name: &str,
_arena: &mut InferTyArena,
_out: &mut Vec<MethodCand>,
)
fn inherent_method_cands( &self, _target: ImplTargetKey, _method_name: &str, _arena: &mut InferTyArena, _out: &mut Vec<MethodCand>, )
Appends inherent
impl method candidates (has_self == true) matching (target, method_name).Source§fn trait_impl_method_cands(
&self,
_target: ImplTargetKey,
_trait_def: GlobalDefId,
_method_name: &str,
_step_ty: InferTyId,
_arena: &mut InferTyArena,
_vars: &mut UnionFindTable,
_out: &mut Vec<MethodCand>,
)
fn trait_impl_method_cands( &self, _target: ImplTargetKey, _trait_def: GlobalDefId, _method_name: &str, _step_ty: InferTyId, _arena: &mut InferTyArena, _vars: &mut UnionFindTable, _out: &mut Vec<MethodCand>, )
Appends concrete and blanket
impl Trait for ... method candidates (has_self == true) for trait_def
(including supertraits of trait_def) matching (target, method_name) and compatible with step_ty.Source§fn trait_decl_method_cand(
&self,
_trait_def: GlobalDefId,
_trait_args: &[InferTyId],
_self_ty: InferTyId,
_method_name: &str,
_arena: &mut InferTyArena,
) -> Option<MethodCand>
fn trait_decl_method_cand( &self, _trait_def: GlobalDefId, _trait_args: &[InferTyId], _self_ty: InferTyId, _method_name: &str, _arena: &mut InferTyArena, ) -> Option<MethodCand>
Looks up
method_name (has_self == true) directly on trait_def (or its supertraits) for Param/Dyn/Opaque receivers.Source§fn method_sig(
&self,
cand: &MethodCand,
arena: &mut InferTyArena,
inputs_out: &mut Vec<InferTyId>,
) -> Option<InferTyId>
fn method_sig( &self, cand: &MethodCand, arena: &mut InferTyArena, inputs_out: &mut Vec<InferTyId>, ) -> Option<InferTyId>
Materializes
cand.method_def’s formal parameter types (inputs_out[0] = self_param_ty) and return type.Source§fn trait_supertraits(
&self,
_trait_def: GlobalDefId,
_out: &mut Vec<GlobalDefId>,
)
fn trait_supertraits( &self, _trait_def: GlobalDefId, _out: &mut Vec<GlobalDefId>, )
Appends direct supertraits (and optional instantiated trait args) of
trait_def.Source§fn param_trait_bounds(
&self,
_owner_def: GlobalDefId,
_param_idx: u16,
_out: &mut Vec<GlobalDefId>,
)
fn param_trait_bounds( &self, _owner_def: GlobalDefId, _param_idx: u16, _out: &mut Vec<GlobalDefId>, )
Appends trait bounds
Param(param_idx): BoundTrait declared on owner_def (Fn or AssocFn or Impl).Source§fn assoc_ty_parent_trait(&self, _assoc_def: GlobalDefId) -> Option<GlobalDefId>
fn assoc_ty_parent_trait(&self, _assoc_def: GlobalDefId) -> Option<GlobalDefId>
Returns the parent
Trait GlobalDefId of a trait associated type assoc_def.Source§fn assoc_ty_trait_bounds(
&self,
_assoc_def: GlobalDefId,
_out: &mut Vec<GlobalDefId>,
)
fn assoc_ty_trait_bounds( &self, _assoc_def: GlobalDefId, _out: &mut Vec<GlobalDefId>, )
Appends trait bounds
type Assoc: BoundTrait declared on trait associated type assoc_def.Source§fn check_blanket_method_bounds(
&self,
_cand: &MethodCand,
_impl_subst: &[InferTyId],
_arena: &mut InferTyArena,
_vars: &mut UnionFindTable,
) -> bool
fn check_blanket_method_bounds( &self, _cand: &MethodCand, _impl_subst: &[InferTyId], _arena: &mut InferTyArena, _vars: &mut UnionFindTable, ) -> bool
Verifies blanket-impl
where bounds after binding impl_subst against a method receiver.Source§fn trait_of_assoc_fn(&self, _assoc_fn: GlobalDefId) -> Option<TraitAssocFnMeta>
fn trait_of_assoc_fn(&self, _assoc_fn: GlobalDefId) -> Option<TraitAssocFnMeta>
Returns canonical trait
AssocFn metadata if assoc_fn is a trait declaration method or a trait-impl override.Source§fn refine_inherent_assoc_fn(
&self,
assoc_fn: GlobalDefId,
_qself_ty: InferTyId,
_arena: &mut InferTyArena,
_vars: &mut UnionFindTable,
) -> GlobalDefId
fn refine_inherent_assoc_fn( &self, assoc_fn: GlobalDefId, _qself_ty: InferTyId, _arena: &mut InferTyArena, _vars: &mut UnionFindTable, ) -> GlobalDefId
Refines an inherent
AssocFn when multiple specialized inherent impl blocks exist for qself_ty (e.g. AtomicUsize::new).Source§fn trait_assoc_fn_by_name(
&self,
_trait_def: GlobalDefId,
_fn_name: &str,
) -> Option<TraitAssocFnMeta>
fn trait_assoc_fn_by_name( &self, _trait_def: GlobalDefId, _fn_name: &str, ) -> Option<TraitAssocFnMeta>
Looks up canonical trait
AssocFn metadata by (trait_def, fn_name) (including static methods without self).Source§fn owner_where_obligations(
&self,
_owner_def: GlobalDefId,
_arena: &mut InferTyArena,
_out: &mut Vec<WhereObligation>,
)
fn owner_where_obligations( &self, _owner_def: GlobalDefId, _arena: &mut InferTyArena, _out: &mut Vec<WhereObligation>, )
Appends parameterized
TraitBound and ProjectionEq where obligations declared on owner_def (and enclosing impl/trait).Source§fn impl_trait_bounds(
&self,
_cand: &MethodCand,
_arena: &mut InferTyArena,
_out: &mut Vec<WhereObligation>,
)
fn impl_trait_bounds( &self, _cand: &MethodCand, _arena: &mut InferTyArena, _out: &mut Vec<WhereObligation>, )
The trait bounds of the indexed
impl that cand belongs to, with the impl’s generic parameters as
Param { idx } in the order check_blanket_method_bounds substitutes them.Source§fn solve_trait_obligation(
&self,
_trait_def: GlobalDefId,
_self_ty: InferTyId,
_trait_args: &[InferTyId],
_arena: &mut InferTyArena,
_vars: &mut UnionFindTable,
) -> bool
fn solve_trait_obligation( &self, _trait_def: GlobalDefId, _self_ty: InferTyId, _trait_args: &[InferTyId], _arena: &mut InferTyArena, _vars: &mut UnionFindTable, ) -> bool
Solves
<self_ty as trait_def<trait_args>> against concrete and bound-checked blanket impls (Checkbox 3.4),
committing variable bindings into vars when a unique candidate impl matches.Source§fn project_param_assoc(
&self,
_owner_def: GlobalDefId,
_param_idx: u16,
_trait_def: GlobalDefId,
_assoc_def: GlobalDefId,
_trait_args: &[InferTyId],
_arena: &mut InferTyArena,
) -> Option<InferTyId>
fn project_param_assoc( &self, _owner_def: GlobalDefId, _param_idx: u16, _trait_def: GlobalDefId, _assoc_def: GlobalDefId, _trait_args: &[InferTyId], _arena: &mut InferTyArena, ) -> Option<InferTyId>
Projects
<Param(param_idx) as trait_def<trait_args>>::assoc_def from owner_def’s ProjectionEq bounds.Source§fn cstr_def(&self) -> Option<GlobalDefId>
fn cstr_def(&self) -> Option<GlobalDefId>
Optional
core::ffi::CStr definition for c"..." literals (&CStr).Source§fn generic_param_default_ty(
&self,
_def: GlobalDefId,
_param_idx: u16,
_arena: &mut InferTyArena,
) -> Option<InferTyId>
fn generic_param_default_ty( &self, _def: GlobalDefId, _param_idx: u16, _arena: &mut InferTyArena, ) -> Option<InferTyId>
Returns the parameterized default type (
Param { idx: 0..param_idx }) declared on non-lifetime
generic parameter param_idx of def (e.g. Global on Vec<T, A = Global>).Source§fn std_macro_ty(
&self,
kind: StdMacroTy,
arena: &mut InferTyArena,
) -> Option<InferTyId>
fn std_macro_ty( &self, kind: StdMacroTy, arena: &mut InferTyArena, ) -> Option<InferTyId>
Constructs a well-known stdlib macro result type (
Vec<T, Global>, String, fmt::Arguments, fmt::Result, Option<&str>).Auto Trait Implementations§
impl Forget for EmptyTyDefDb
impl Freeze for EmptyTyDefDb
impl Move for EmptyTyDefDb
impl RefUnwindSafe for EmptyTyDefDb
impl Send for EmptyTyDefDb
impl Sync for EmptyTyDefDb
impl Unpin for EmptyTyDefDb
impl UnsafeUnpin for EmptyTyDefDb
impl UnwindSafe for EmptyTyDefDb
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