@@ -537,8 +537,8 @@ impl<'d,'t,'a,'tcx> ExprUseVisitor<'d,'t,'a,'tcx> {
537537 self . consume_expr ( & count) ;
538538 }
539539
540- hir:: ExprClosure ( .. ) => {
541- self . walk_captures ( expr)
540+ hir:: ExprClosure ( _ , _ , _ , fn_decl_span ) => {
541+ self . walk_captures ( expr, fn_decl_span )
542542 }
543543
544544 hir:: ExprBox ( ref base) => {
@@ -1142,7 +1142,7 @@ impl<'d,'t,'a,'tcx> ExprUseVisitor<'d,'t,'a,'tcx> {
11421142 } ) ) ;
11431143 }
11441144
1145- fn walk_captures ( & mut self , closure_expr : & hir:: Expr ) {
1145+ fn walk_captures ( & mut self , closure_expr : & hir:: Expr , fn_decl_span : Span ) {
11461146 debug ! ( "walk_captures({:?})" , closure_expr) ;
11471147
11481148 self . tcx ( ) . with_freevars ( closure_expr. id , |freevars| {
@@ -1152,7 +1152,7 @@ impl<'d,'t,'a,'tcx> ExprUseVisitor<'d,'t,'a,'tcx> {
11521152 closure_expr_id : closure_expr. id } ;
11531153 let upvar_capture = self . typer . upvar_capture ( upvar_id) . unwrap ( ) ;
11541154 let cmt_var = return_if_err ! ( self . cat_captured_var( closure_expr. id,
1155- closure_expr . span ,
1155+ fn_decl_span ,
11561156 freevar. def) ) ;
11571157 match upvar_capture {
11581158 ty:: UpvarCapture :: ByValue => {
@@ -1161,7 +1161,7 @@ impl<'d,'t,'a,'tcx> ExprUseVisitor<'d,'t,'a,'tcx> {
11611161 }
11621162 ty:: UpvarCapture :: ByRef ( upvar_borrow) => {
11631163 self . delegate . borrow ( closure_expr. id ,
1164- closure_expr . span ,
1164+ fn_decl_span ,
11651165 cmt_var,
11661166 upvar_borrow. region ,
11671167 upvar_borrow. kind ,
0 commit comments