@@ -424,7 +424,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
424424 origin = updated. 1 ;
425425
426426 let ( place, capture_kind) = match capture_clause {
427- hir:: CaptureBy :: Value => adjust_for_move_closure ( place, capture_kind) ,
427+ hir:: CaptureBy :: Value { .. } => adjust_for_move_closure ( place, capture_kind) ,
428428 hir:: CaptureBy :: Ref => adjust_for_non_move_closure ( place, capture_kind) ,
429429 } ;
430430
@@ -958,7 +958,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
958958 let ty = self . resolve_vars_if_possible ( self . node_ty ( var_hir_id) ) ;
959959
960960 let ty = match closure_clause {
961- hir:: CaptureBy :: Value => ty, // For move closure the capture kind should be by value
961+ hir:: CaptureBy :: Value { .. } => ty, // For move closure the capture kind should be by value
962962 hir:: CaptureBy :: Ref => {
963963 // For non move closure the capture kind is the max capture kind of all captures
964964 // according to the ordering ImmBorrow < UniqueImmBorrow < MutBorrow < ByValue
@@ -1073,7 +1073,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10731073
10741074 match closure_clause {
10751075 // Only migrate if closure is a move closure
1076- hir:: CaptureBy :: Value => {
1076+ hir:: CaptureBy :: Value { .. } => {
10771077 let mut diagnostics_info = FxIndexSet :: default ( ) ;
10781078 let upvars =
10791079 self . tcx . upvars_mentioned ( closure_def_id) . expect ( "must be an upvar" ) ;
@@ -1479,10 +1479,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
14791479 // If the data will be moved out of this place, then the place will be truncated
14801480 // at the first Deref in `adjust_upvar_borrow_kind_for_consume` and then moved into
14811481 // the closure.
1482- hir:: CaptureBy :: Value if !place. deref_tys ( ) . any ( Ty :: is_ref) => {
1482+ hir:: CaptureBy :: Value { .. } if !place. deref_tys ( ) . any ( Ty :: is_ref) => {
14831483 ty:: UpvarCapture :: ByValue
14841484 }
1485- hir:: CaptureBy :: Value | hir:: CaptureBy :: Ref => ty:: UpvarCapture :: ByRef ( ty:: ImmBorrow ) ,
1485+ hir:: CaptureBy :: Value { .. } | hir:: CaptureBy :: Ref => {
1486+ ty:: UpvarCapture :: ByRef ( ty:: ImmBorrow )
1487+ }
14861488 }
14871489 }
14881490
0 commit comments