Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/next_solver/infer/traits.rs')
| -rw-r--r-- | crates/hir-ty/src/next_solver/infer/traits.rs | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/crates/hir-ty/src/next_solver/infer/traits.rs b/crates/hir-ty/src/next_solver/infer/traits.rs index 4f000c24cc..14df42dc2a 100644 --- a/crates/hir-ty/src/next_solver/infer/traits.rs +++ b/crates/hir-ty/src/next_solver/infer/traits.rs @@ -9,8 +9,11 @@ use std::{ use hir_def::TraitId; use macros::{TypeFoldable, TypeVisitable}; -use rustc_type_ir::Upcast; use rustc_type_ir::elaborate::Elaboratable; +use rustc_type_ir::{ + Upcast, + solve::{Certainty, NoSolution, inspect}, +}; use tracing::debug; use crate::next_solver::{ @@ -36,10 +39,6 @@ pub struct ObligationCause { } impl ObligationCause { - #[expect( - clippy::new_without_default, - reason = "`new` is temporary, eventually we will provide span etc. here" - )] #[inline] pub fn new() -> ObligationCause { ObligationCause { _private: () } @@ -83,6 +82,15 @@ pub struct Obligation<'db, T> { pub recursion_depth: usize, } +/// A callback that can be provided to `inspect_typeck`. Invoked on evaluation +/// of root obligations. +pub type ObligationInspector<'db> = fn( + &InferCtxt<'db>, + &PredicateObligation<'db>, + Result<Certainty, NoSolution>, + Option<inspect::GoalEvaluation<DbInterner<'db>>>, +); + /// For [`Obligation`], a sub-obligation is combined with the current obligation's /// param-env and cause code. impl<'db> Elaboratable<DbInterner<'db>> for PredicateObligation<'db> { |