Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/next_solver/solver.rs')
| -rw-r--r-- | crates/hir-ty/src/next_solver/solver.rs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/crates/hir-ty/src/next_solver/solver.rs b/crates/hir-ty/src/next_solver/solver.rs index 8fae340dde..68b6ebf7e9 100644 --- a/crates/hir-ty/src/next_solver/solver.rs +++ b/crates/hir-ty/src/next_solver/solver.rs @@ -1,6 +1,6 @@ //! Defining `SolverContext` for next-trait-solver. -use hir_def::{AssocItemId, GeneralConstId}; +use hir_def::AssocItemId; use rustc_next_trait_solver::delegate::SolverDelegate; use rustc_type_ir::{ AliasTyKind, GenericArgKind, InferCtxtLike, Interner, PredicatePolarity, TypeFlags, @@ -233,14 +233,18 @@ impl<'db> SolverDelegate for SolverContext<'db> { _param_env: ParamEnv<'db>, uv: rustc_type_ir::UnevaluatedConst<Self::Interner>, ) -> Option<<Self::Interner as rustc_type_ir::Interner>::Const> { - let c = match uv.def { - SolverDefId::ConstId(c) => GeneralConstId::ConstId(c), - SolverDefId::StaticId(c) => GeneralConstId::StaticId(c), + match uv.def { + SolverDefId::ConstId(c) => { + let subst = uv.args; + let ec = self.cx().db.const_eval(c, subst, None).ok()?; + Some(ec) + } + SolverDefId::StaticId(c) => { + let ec = self.cx().db.const_eval_static(c).ok()?; + Some(ec) + } _ => unreachable!(), - }; - let subst = uv.args; - let ec = self.cx().db.const_eval(c, subst, None).ok()?; - Some(ec) + } } fn compute_goal_fast_path( |