Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer/closure/analysis.rs')
-rw-r--r--crates/hir-ty/src/infer/closure/analysis.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/hir-ty/src/infer/closure/analysis.rs b/crates/hir-ty/src/infer/closure/analysis.rs
index 251e7f7cf6..308c01865a 100644
--- a/crates/hir-ty/src/infer/closure/analysis.rs
+++ b/crates/hir-ty/src/infer/closure/analysis.rs
@@ -43,11 +43,12 @@ impl<'db> HirPlace<'db> {
for p in &self.projections {
ty = p.projected_ty(
&ctx.table.infer_ctxt,
+ ctx.table.param_env,
ty,
|_, _, _| {
unreachable!("Closure field only happens in MIR");
},
- ctx.owner.module(ctx.db).krate(),
+ ctx.owner.module(ctx.db).krate(ctx.db),
);
}
ty
@@ -149,7 +150,7 @@ impl<'db> CapturedItem<'db> {
}
}
}
- if is_raw_identifier(&result, owner.module(db).krate().data(db).edition) {
+ if is_raw_identifier(&result, owner.module(db).krate(db).data(db).edition) {
result.insert_str(0, "r#");
}
result
@@ -839,11 +840,12 @@ impl<'db> InferenceContext<'_, 'db> {
for (i, p) in capture.place.projections.iter().enumerate() {
ty = p.projected_ty(
&self.table.infer_ctxt,
+ self.table.param_env,
ty,
|_, _, _| {
unreachable!("Closure field only happens in MIR");
},
- self.owner.module(self.db).krate(),
+ self.owner.module(self.db).krate(self.db),
);
if ty.is_raw_ptr() || ty.is_union() {
capture.kind = CaptureKind::ByRef(BorrowKind::Shared);