Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer/diagnostics.rs')
-rw-r--r--crates/hir-ty/src/infer/diagnostics.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/crates/hir-ty/src/infer/diagnostics.rs b/crates/hir-ty/src/infer/diagnostics.rs
index 71aa35e634..a08a8a023e 100644
--- a/crates/hir-ty/src/infer/diagnostics.rs
+++ b/crates/hir-ty/src/infer/diagnostics.rs
@@ -2,7 +2,7 @@
//! and a wrapper around [`TyLoweringContext`] ([`InferenceTyLoweringContext`]) that replaces
//! it and takes care of diagnostics in inference.
-use std::cell::RefCell;
+use std::cell::{OnceCell, RefCell};
use std::ops::{Deref, DerefMut};
use either::Either;
@@ -16,6 +16,7 @@ use thin_vec::ThinVec;
use crate::{
InferenceDiagnostic, InferenceTyDiagnosticSource, TyLoweringDiagnostic,
db::{AnonConstId, HirDatabase},
+ generics::Generics,
lower::{
ForbidParamsAfterReason, LifetimeElisionKind, TyLoweringContext,
path::{PathDiagnosticCallback, PathLoweringContext},
@@ -71,12 +72,20 @@ impl<'db, 'a> InferenceTyLoweringContext<'db, 'a> {
source: InferenceTyDiagnosticSource,
def: ExpressionStoreOwnerId,
generic_def: GenericDefId,
+ generics: &'a OnceCell<Generics<'db>>,
lifetime_elision: LifetimeElisionKind<'db>,
allow_using_generic_params: bool,
defined_anon_consts: &'a RefCell<ThinVec<AnonConstId>>,
) -> Self {
- let mut ctx =
- TyLoweringContext::new(db, resolver, store, def, generic_def, lifetime_elision);
+ let mut ctx = TyLoweringContext::new(
+ db,
+ resolver,
+ store,
+ def,
+ generic_def,
+ generics,
+ lifetime_elision,
+ );
if !allow_using_generic_params {
ctx.forbid_params_after(0, ForbidParamsAfterReason::AnonConst);
}