SolverDelegate add assoc type for Infcx

This commit is contained in:
lcnr 2024-10-17 11:38:40 +02:00
parent 06d261daf6
commit c45073ec3e
2 changed files with 3 additions and 3 deletions

View File

@ -4,9 +4,8 @@ use rustc_type_ir::fold::TypeFoldable;
use rustc_type_ir::solve::{Certainty, Goal, NoSolution, SolverMode};
use rustc_type_ir::{self as ty, InferCtxtLike, Interner};
pub trait SolverDelegate:
Deref<Target: InferCtxtLike<Interner = <Self as SolverDelegate>::Interner>> + Sized
{
pub trait SolverDelegate: Deref<Target = <Self as SolverDelegate>::Infcx> + Sized {
type Infcx: InferCtxtLike<Interner = <Self as SolverDelegate>::Interner>;
type Interner: Interner;
fn cx(&self) -> Self::Interner {
(**self).cx()

View File

@ -36,6 +36,7 @@ impl<'tcx> Deref for SolverDelegate<'tcx> {
}
impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate<'tcx> {
type Infcx = InferCtxt<'tcx>;
type Interner = TyCtxt<'tcx>;
fn cx(&self) -> TyCtxt<'tcx> {