Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fb4e618

Browse files
committedNov 9, 2014
Fix upvars sometimes not being marked as used mutably
Drill down the loan path for McDeclared references as well since it might lead to an upvar. Closes #18769
1 parent 93c85eb commit fb4e618

File tree

1 file changed

+2
-2
lines changed
  • src/librustc/middle/borrowck/gather_loans

1 file changed

+2
-2
lines changed
 

‎src/librustc/middle/borrowck/gather_loans/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,10 @@ impl<'a, 'tcx> GatherLoanCtxt<'a, 'tcx> {
395395
LpUpvar(ty::UpvarId{ var_id: local_id, closure_expr_id: _ }) => {
396396
self.tcx().used_mut_nodes.borrow_mut().insert(local_id);
397397
}
398-
LpExtend(ref base, mc::McInherited, _) => {
398+
LpExtend(ref base, mc::McInherited, _) |
399+
LpExtend(ref base, mc::McDeclared, _) => {
399400
self.mark_loan_path_as_mutated(&**base);
400401
}
401-
LpExtend(_, mc::McDeclared, _) |
402402
LpExtend(_, mc::McImmutable, _) => {
403403
// Nothing to do.
404404
}

0 commit comments

Comments
 (0)
Please sign in to comment.