diff options
| author | bors <bors@rust-lang.org> | 2025-05-22 11:39:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-05-22 11:39:10 +0000 |
| commit | d423c815a69bbcfb4abcd23a828b9a513c397632 (patch) | |
| tree | 7deb57c5cec7bf8c544004fa76531d6fcb656612 /compiler/rustc_next_trait_solver/src/delegate.rs | |
| parent | 1d679446b01e65f9bc9ae609d0ae1e4a9c0ccaa3 (diff) | |
| parent | 407fac54798cf225b81b67cad2525a0acbda9b03 (diff) | |
| download | rust-d423c815a69bbcfb4abcd23a828b9a513c397632.tar.gz rust-d423c815a69bbcfb4abcd23a828b9a513c397632.zip | |
Auto merge of #141135 - compiler-errors:fast-path-2, r=lcnr
Fast path for processing some obligations in the new solver Fast path applies to: - Dyn compatibility predicates - Region and type outlives predicates - Trivially sized predicates
Diffstat (limited to 'compiler/rustc_next_trait_solver/src/delegate.rs')
| -rw-r--r-- | compiler/rustc_next_trait_solver/src/delegate.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_next_trait_solver/src/delegate.rs b/compiler/rustc_next_trait_solver/src/delegate.rs index 90a7c2e9f78..bb923612cff 100644 --- a/compiler/rustc_next_trait_solver/src/delegate.rs +++ b/compiler/rustc_next_trait_solver/src/delegate.rs @@ -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, |
