Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/mir/lower.rs')
-rw-r--r--crates/hir-ty/src/mir/lower.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/crates/hir-ty/src/mir/lower.rs b/crates/hir-ty/src/mir/lower.rs
index 3a0d0c933f..9e23550451 100644
--- a/crates/hir-ty/src/mir/lower.rs
+++ b/crates/hir-ty/src/mir/lower.rs
@@ -1180,8 +1180,15 @@ impl<'ctx> MirLowerCtx<'ctx> {
let placeholder_subst = self.placeholder_subst();
let tmp_ty =
capture.ty.clone().substitute(Interner, &placeholder_subst);
- let tmp: Place = self.temp(tmp_ty, current, capture.span)?.into();
- self.push_assignment(current, tmp, Rvalue::Ref(*bk, p), capture.span);
+ // FIXME: Handle more than one span.
+ let capture_spans = capture.spans();
+ let tmp: Place = self.temp(tmp_ty, current, capture_spans[0])?.into();
+ self.push_assignment(
+ current,
+ tmp,
+ Rvalue::Ref(*bk, p),
+ capture_spans[0],
+ );
operands.push(Operand::Move(tmp));
}
CaptureKind::ByValue => operands.push(Operand::Move(p)),