@@ -537,8 +537,8 @@ impl<'d,'t,'a,'tcx> ExprUseVisitor<'d,'t,'a,'tcx> {
537
537
self . consume_expr ( & count) ;
538
538
}
539
539
540
- hir:: ExprClosure ( .. ) => {
541
- self . walk_captures ( expr)
540
+ hir:: ExprClosure ( _ , _ , _ , fn_decl_span ) => {
541
+ self . walk_captures ( expr, fn_decl_span )
542
542
}
543
543
544
544
hir:: ExprBox ( ref base) => {
@@ -1142,7 +1142,7 @@ impl<'d,'t,'a,'tcx> ExprUseVisitor<'d,'t,'a,'tcx> {
1142
1142
} ) ) ;
1143
1143
}
1144
1144
1145
- fn walk_captures ( & mut self , closure_expr : & hir:: Expr ) {
1145
+ fn walk_captures ( & mut self , closure_expr : & hir:: Expr , fn_decl_span : Span ) {
1146
1146
debug ! ( "walk_captures({:?})" , closure_expr) ;
1147
1147
1148
1148
self . tcx ( ) . with_freevars ( closure_expr. id , |freevars| {
@@ -1152,7 +1152,7 @@ impl<'d,'t,'a,'tcx> ExprUseVisitor<'d,'t,'a,'tcx> {
1152
1152
closure_expr_id : closure_expr. id } ;
1153
1153
let upvar_capture = self . typer . upvar_capture ( upvar_id) . unwrap ( ) ;
1154
1154
let cmt_var = return_if_err ! ( self . cat_captured_var( closure_expr. id,
1155
- closure_expr . span ,
1155
+ fn_decl_span ,
1156
1156
freevar. def) ) ;
1157
1157
match upvar_capture {
1158
1158
ty:: UpvarCapture :: ByValue => {
@@ -1161,7 +1161,7 @@ impl<'d,'t,'a,'tcx> ExprUseVisitor<'d,'t,'a,'tcx> {
1161
1161
}
1162
1162
ty:: UpvarCapture :: ByRef ( upvar_borrow) => {
1163
1163
self . delegate . borrow ( closure_expr. id ,
1164
- closure_expr . span ,
1164
+ fn_decl_span ,
1165
1165
cmt_var,
1166
1166
upvar_borrow. region ,
1167
1167
upvar_borrow. kind ,
0 commit comments