Fast path for processing some obligations in the new solver

This commit is contained in:
Michael Goulet
2025-05-17 19:41:06 +00:00
parent 7205fc537d
commit 1d0d258a86
5 changed files with 67 additions and 7 deletions

View File

@@ -3,6 +3,8 @@ use std::ops::Deref;
use rustc_type_ir::solve::{Certainty, Goal, NoSolution};
use rustc_type_ir::{self as ty, InferCtxtLike, Interner, TypeFoldable};
use crate::solve::HasChanged;
pub trait SolverDelegate: Deref<Target = Self::Infcx> + Sized {
type Infcx: InferCtxtLike<Interner = Self::Interner>;
type Interner: Interner;
@@ -17,6 +19,12 @@ pub trait SolverDelegate: Deref<Target = Self::Infcx> + Sized {
where
V: TypeFoldable<Self::Interner>;
fn compute_goal_fast_path(
&self,
goal: Goal<Self::Interner, <Self::Interner as Interner>::Predicate>,
span: <Self::Interner as Interner>::Span,
) -> Option<HasChanged>;
fn fresh_var_for_kind_with_span(
&self,
arg: <Self::Interner as Interner>::GenericArg,