self.lower_lifetime_binder(closure_id, generic_params, |lctx, bound_generic_params| {
// Lower outside new scope to preserve `is_in_loop_condition`.
- let fn_decl = lctx.lower_fn_decl(decl, None, FnDeclKind::Closure, None);
+ let fn_decl = lctx.lower_fn_decl(decl, None, fn_decl_span, FnDeclKind::Closure, None);
let c = lctx.arena.alloc(hir::Closure {
binder: binder_clause,
// We need to lower the declaration outside the new scope, because we
// have to conserve the state of being inside a loop condition for the
// closure argument types.
- let fn_decl = lctx.lower_fn_decl(&outer_decl, None, FnDeclKind::Closure, None);
+ let fn_decl =
+ lctx.lower_fn_decl(&outer_decl, None, fn_decl_span, FnDeclKind::Closure, None);
let c = lctx.arena.alloc(hir::Closure {
binder: binder_clause,
&mut ImplTraitContext::Disallowed(ImplTraitPosition::Path),
);
// Destructure like a tuple struct.
- let tuple_struct_pat =
- hir::PatKind::TupleStruct(qpath, pats, rest.map(|r| r.0));
+ let tuple_struct_pat = hir::PatKind::TupleStruct(
+ qpath,
+ pats,
+ hir::DotDotPos::new(rest.map(|r| r.0)),
+ );
return self.pat_without_dbm(lhs.span, tuple_struct_pat);
}
}
ExprKind::Tup(elements) => {
let (pats, rest) =
self.destructure_sequence(elements, "tuple", eq_sign_span, assignments);
- let tuple_pat = hir::PatKind::Tuple(pats, rest.map(|r| r.0));
+ let tuple_pat = hir::PatKind::Tuple(pats, hir::DotDotPos::new(rest.map(|r| r.0)));
return self.pat_without_dbm(lhs.span, tuple_pat);
}
ExprKind::Paren(e) => {
// We special-case `(..)` for consistency with patterns.
if let ExprKind::Range(None, None, RangeLimits::HalfOpen) = e.kind {
- let tuple_pat = hir::PatKind::Tuple(&[], Some(0));
+ let tuple_pat = hir::PatKind::Tuple(&[], hir::DotDotPos::new(Some(0)));
return self.pat_without_dbm(lhs.span, tuple_pat);
} else {
return self.destructure_assign_mut(e, eq_sign_span, assignments);