about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-10-17 20:47:31 +0200
committerGitHub <noreply@github.com>2024-10-17 20:47:31 +0200
commit405eb4178e1eec5d8487b8790e5cfc7c9ad79c63 (patch)
tree33e011e57932ff1a4c34f61a7a18cda4c2d7cf26
parent7dbd92fadd0d169798e258cef82ea1d31f4c58c2 (diff)
parentc45073ec3ea800b31e634db9de1b51f978521ad5 (diff)
downloadrust-405eb4178e1eec5d8487b8790e5cfc7c9ad79c63.tar.gz
rust-405eb4178e1eec5d8487b8790e5cfc7c9ad79c63.zip
Rollup merge of #131825 - lcnr:probe-no-more-leak-2, r=compiler-errors
SolverDelegate add assoc type for Infcx

makes writing trait bounds on it a lot nicer going forward.

r? `@compiler-errors`
-rw-r--r--compiler/rustc_next_trait_solver/src/delegate.rs5
-rw-r--r--compiler/rustc_trait_selection/src/solve/delegate.rs1
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 76d5f0ea07b..4da1e7fa711 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<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()
diff --git a/compiler/rustc_trait_selection/src/solve/delegate.rs b/compiler/rustc_trait_selection/src/solve/delegate.rs
index 62f56beb34b..5793ac2fc31 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> {