pub trait InferCtxtLike: Sized {
type Interner: Interner;
Show 40 methods
// Required methods
fn cx(&self) -> Self::Interner;
fn solver_mode(&self) -> SolverMode;
fn universe(&self) -> UniverseIndex;
fn create_next_universe(&self) -> UniverseIndex;
fn universe_of_ty(&self, ty: TyVid) -> Option<UniverseIndex>;
fn universe_of_lt(&self, lt: RegionVid) -> Option<UniverseIndex>;
fn universe_of_ct(&self, ct: ConstVid) -> Option<UniverseIndex>;
fn root_ty_var(&self, var: TyVid) -> TyVid;
fn root_const_var(&self, var: ConstVid) -> ConstVid;
fn opportunistic_resolve_ty_var(
&self,
vid: TyVid,
) -> <Self::Interner as Interner>::Ty;
fn opportunistic_resolve_int_var(
&self,
vid: IntVid,
) -> <Self::Interner as Interner>::Ty;
fn opportunistic_resolve_float_var(
&self,
vid: FloatVid,
) -> <Self::Interner as Interner>::Ty;
fn opportunistic_resolve_ct_var(
&self,
vid: ConstVid,
) -> <Self::Interner as Interner>::Const;
fn opportunistic_resolve_effect_var(
&self,
vid: EffectVid,
) -> <Self::Interner as Interner>::Const;
fn opportunistic_resolve_lt_var(
&self,
vid: RegionVid,
) -> <Self::Interner as Interner>::Region;
fn defining_opaque_types(
&self,
) -> <Self::Interner as Interner>::DefiningOpaqueTypes;
fn next_ty_infer(&self) -> <Self::Interner as Interner>::Ty;
fn next_const_infer(&self) -> <Self::Interner as Interner>::Const;
fn fresh_args_for_item(
&self,
def_id: <Self::Interner as Interner>::DefId,
) -> <Self::Interner as Interner>::GenericArgs;
fn instantiate_binder_with_infer<T>(
&self,
value: Binder<Self::Interner, T>,
) -> T
where T: TypeFoldable<Self::Interner> + Copy;
fn enter_forall<T, U>(
&self,
value: Binder<Self::Interner, T>,
f: impl FnOnce(T) -> U,
) -> U
where T: TypeFoldable<Self::Interner> + Copy;
fn equate_ty_vids_raw(&self, a: TyVid, b: TyVid);
fn equate_int_vids_raw(&self, a: IntVid, b: IntVid);
fn equate_float_vids_raw(&self, a: FloatVid, b: FloatVid);
fn equate_const_vids_raw(&self, a: ConstVid, b: ConstVid);
fn equate_effect_vids_raw(&self, a: EffectVid, b: EffectVid);
fn instantiate_ty_var_raw<R>(
&self,
relation: &mut R,
target_is_expected: bool,
target_vid: TyVid,
instantiation_variance: Variance,
source_ty: <Self::Interner as Interner>::Ty,
) -> Result<(), TypeError<Self::Interner>>
where R: PredicateEmittingRelation<Self>;
fn instantiate_int_var_raw(&self, vid: IntVid, value: IntVarValue);
fn instantiate_float_var_raw(&self, vid: FloatVid, value: FloatVarValue);
fn instantiate_effect_var_raw(
&self,
vid: EffectVid,
value: <Self::Interner as Interner>::Const,
);
fn instantiate_const_var_raw<R>(
&self,
relation: &mut R,
target_is_expected: bool,
target_vid: ConstVid,
source_ct: <Self::Interner as Interner>::Const,
) -> Result<(), TypeError<Self::Interner>>
where R: PredicateEmittingRelation<Self>;
fn set_tainted_by_errors(
&self,
e: <Self::Interner as Interner>::ErrorGuaranteed,
);
fn shallow_resolve(
&self,
ty: <Self::Interner as Interner>::Ty,
) -> <Self::Interner as Interner>::Ty;
fn shallow_resolve_const(
&self,
ty: <Self::Interner as Interner>::Const,
) -> <Self::Interner as Interner>::Const;
fn resolve_vars_if_possible<T>(&self, value: T) -> T
where T: TypeFoldable<Self::Interner>;
fn probe<T>(&self, probe: impl FnOnce() -> T) -> T;
fn sub_regions(
&self,
sub: <Self::Interner as Interner>::Region,
sup: <Self::Interner as Interner>::Region,
);
fn equate_regions(
&self,
a: <Self::Interner as Interner>::Region,
b: <Self::Interner as Interner>::Region,
);
fn register_ty_outlives(
&self,
ty: <Self::Interner as Interner>::Ty,
r: <Self::Interner as Interner>::Region,
);
// Provided method
fn next_trait_solver(&self) -> bool { ... }
}
Required Associated Types§
Required Methods§
fn cx(&self) -> Self::Interner
fn solver_mode(&self) -> SolverMode
fn universe(&self) -> UniverseIndex
fn create_next_universe(&self) -> UniverseIndex
fn universe_of_ty(&self, ty: TyVid) -> Option<UniverseIndex>
fn universe_of_lt(&self, lt: RegionVid) -> Option<UniverseIndex>
fn universe_of_ct(&self, ct: ConstVid) -> Option<UniverseIndex>
fn root_ty_var(&self, var: TyVid) -> TyVid
fn root_const_var(&self, var: ConstVid) -> ConstVid
fn opportunistic_resolve_ty_var( &self, vid: TyVid, ) -> <Self::Interner as Interner>::Ty
fn opportunistic_resolve_int_var( &self, vid: IntVid, ) -> <Self::Interner as Interner>::Ty
fn opportunistic_resolve_float_var( &self, vid: FloatVid, ) -> <Self::Interner as Interner>::Ty
fn opportunistic_resolve_ct_var( &self, vid: ConstVid, ) -> <Self::Interner as Interner>::Const
fn opportunistic_resolve_effect_var( &self, vid: EffectVid, ) -> <Self::Interner as Interner>::Const
fn opportunistic_resolve_lt_var( &self, vid: RegionVid, ) -> <Self::Interner as Interner>::Region
fn defining_opaque_types( &self, ) -> <Self::Interner as Interner>::DefiningOpaqueTypes
fn next_ty_infer(&self) -> <Self::Interner as Interner>::Ty
fn next_const_infer(&self) -> <Self::Interner as Interner>::Const
fn fresh_args_for_item( &self, def_id: <Self::Interner as Interner>::DefId, ) -> <Self::Interner as Interner>::GenericArgs
fn instantiate_binder_with_infer<T>( &self, value: Binder<Self::Interner, T>, ) -> T
fn enter_forall<T, U>( &self, value: Binder<Self::Interner, T>, f: impl FnOnce(T) -> U, ) -> U
fn equate_ty_vids_raw(&self, a: TyVid, b: TyVid)
fn equate_int_vids_raw(&self, a: IntVid, b: IntVid)
fn equate_float_vids_raw(&self, a: FloatVid, b: FloatVid)
fn equate_const_vids_raw(&self, a: ConstVid, b: ConstVid)
fn equate_effect_vids_raw(&self, a: EffectVid, b: EffectVid)
fn instantiate_ty_var_raw<R>(
&self,
relation: &mut R,
target_is_expected: bool,
target_vid: TyVid,
instantiation_variance: Variance,
source_ty: <Self::Interner as Interner>::Ty,
) -> Result<(), TypeError<Self::Interner>>where
R: PredicateEmittingRelation<Self>,
fn instantiate_int_var_raw(&self, vid: IntVid, value: IntVarValue)
fn instantiate_float_var_raw(&self, vid: FloatVid, value: FloatVarValue)
fn instantiate_effect_var_raw( &self, vid: EffectVid, value: <Self::Interner as Interner>::Const, )
fn instantiate_const_var_raw<R>(
&self,
relation: &mut R,
target_is_expected: bool,
target_vid: ConstVid,
source_ct: <Self::Interner as Interner>::Const,
) -> Result<(), TypeError<Self::Interner>>where
R: PredicateEmittingRelation<Self>,
fn set_tainted_by_errors( &self, e: <Self::Interner as Interner>::ErrorGuaranteed, )
fn shallow_resolve( &self, ty: <Self::Interner as Interner>::Ty, ) -> <Self::Interner as Interner>::Ty
fn shallow_resolve_const( &self, ty: <Self::Interner as Interner>::Const, ) -> <Self::Interner as Interner>::Const
fn resolve_vars_if_possible<T>(&self, value: T) -> Twhere
T: TypeFoldable<Self::Interner>,
fn probe<T>(&self, probe: impl FnOnce() -> T) -> T
fn sub_regions( &self, sub: <Self::Interner as Interner>::Region, sup: <Self::Interner as Interner>::Region, )
fn equate_regions( &self, a: <Self::Interner as Interner>::Region, b: <Self::Interner as Interner>::Region, )
fn register_ty_outlives( &self, ty: <Self::Interner as Interner>::Ty, r: <Self::Interner as Interner>::Region, )
Provided Methods§
sourcefn next_trait_solver(&self) -> bool
fn next_trait_solver(&self) -> bool
Whether the new trait solver is enabled. This only exists because rustc shares code between the new and old trait solvers; for all other users, this should always be true. If this is unknowingly false and you try to use the new trait solver, things will break badly.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.