Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/consteval.rs')
| -rw-r--r-- | crates/hir-ty/src/consteval.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/hir-ty/src/consteval.rs b/crates/hir-ty/src/consteval.rs index 21e368c88f..e1d6cec594 100644 --- a/crates/hir-ty/src/consteval.rs +++ b/crates/hir-ty/src/consteval.rs @@ -19,7 +19,7 @@ use rustc_type_ir::inherent::{Const as _, GenericArgs as _, IntoKind, Ty as _}; use stdx::never; use crate::{ - ParamEnvAndCrate, + ParamEnvAndCrate, Span, db::{AnonConstId, AnonConstLoc, GeneralConstId, HirDatabase}, display::DisplayTarget, generics::Generics, @@ -27,7 +27,7 @@ use crate::{ next_solver::{ Allocation, Const, ConstKind, Consts, DbInterner, DefaultAny, GenericArgs, ParamConst, ScalarInt, StoredAllocation, StoredEarlyBinder, StoredGenericArgs, Ty, TyKind, - UnevaluatedConst, ValTreeKind, default_types, infer::InferCtxt, + UnevaluatedConst, ValTreeKind, default_types, }, traits::StoredParamEnvAndCrate, }; @@ -351,13 +351,13 @@ pub(crate) fn create_anon_const<'a, 'db>( resolver: &Resolver<'db>, expected_ty: Ty<'db>, generics: &dyn Fn() -> &'a Generics<'db>, - infcx: Option<&InferCtxt<'db>>, + create_var: Option<&mut dyn FnMut(Span) -> Const<'db>>, forbid_params_after: Option<u32>, ) -> Result<Const<'db>, CreateConstError<'db>> { match &store[expr] { Expr::Literal(literal) => intern_const_ref(interner, literal, expected_ty), - Expr::Underscore => match infcx { - Some(infcx) => Ok(infcx.next_const_var(expr.into())), + Expr::Underscore => match create_var { + Some(create_var) => Ok(create_var(expr.into())), None => Err(CreateConstError::UnderscoreExpr), }, Expr::Path(path) |