From c45073ec3ea800b31e634db9de1b51f978521ad5 Mon Sep 17 00:00:00 2001 From: lcnr Date: Thu, 17 Oct 2024 11:38:40 +0200 Subject: [PATCH] SolverDelegate add assoc type for Infcx --- compiler/rustc_next_trait_solver/src/delegate.rs | 5 ++--- compiler/rustc_trait_selection/src/solve/delegate.rs | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_next_trait_solver/src/delegate.rs b/compiler/rustc_next_trait_solver/src/delegate.rs index 6a3d58b5906..9b656579ca5 100644 --- a/compiler/rustc_next_trait_solver/src/delegate.rs +++ b/compiler/rustc_next_trait_solver/src/delegate.rs @@ -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::Interner>> + Sized -{ +pub trait SolverDelegate: Deref::Infcx> + Sized { + type Infcx: InferCtxtLike::Interner>; type Interner: Interner; fn cx(&self) -> Self::Interner { (**self).cx() diff --git a/compiler/rustc_trait_selection/src/solve/delegate.rs b/compiler/rustc_trait_selection/src/solve/delegate.rs index df9ac2b80fd..b13965db18b 100644 --- a/compiler/rustc_trait_selection/src/solve/delegate.rs +++ b/compiler/rustc_trait_selection/src/solve/delegate.rs @@ -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> {