Skip to content

Commit 09729bd

Browse files
author
Cameron Zwarich
committed
---
yaml --- r: 152588 b: refs/heads/try2 c: 178c4fb h: refs/heads/master v: v3
1 parent fee0754 commit 09729bd

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 702ef1b7215e310a0c5e2e761bef922f36dd5f65
8+
refs/heads/try2: 178c4fbccbc59fc7c554cb3cda33413d7d455366
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/borrowck/check_loans.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -825,14 +825,14 @@ impl<'a> CheckLoanCtxt<'a> {
825825
this: &CheckLoanCtxt,
826826
assignment_id: ast::NodeId,
827827
assignment_span: Span,
828-
assignee_cmt: mc::cmt) -> bool
828+
assignee_cmt: mc::cmt)
829829
{
830830
//! Check for assignments that violate the terms of an
831831
//! outstanding loan.
832832
833833
let loan_path = match opt_loan_path(&assignee_cmt) {
834834
Some(lp) => lp,
835-
None => { return true; /* no loan path, can't be any loans */ }
835+
None => { return; /* no loan path, can't be any loans */ }
836836
};
837837

838838
// Start by searching for an assignment to a *restricted*
@@ -852,7 +852,7 @@ impl<'a> CheckLoanCtxt<'a> {
852852
false
853853
});
854854

855-
if !cont { return false }
855+
if !cont { return; }
856856

857857
// The previous code handled assignments to paths that
858858
// have been restricted. This covers paths that have been
@@ -899,21 +899,19 @@ impl<'a> CheckLoanCtxt<'a> {
899899
LpExtend(_, mc::McDeclared, _) |
900900
LpExtend(_, mc::McImmutable, _) |
901901
LpVar(_) => {
902-
return true;
902+
return;
903903
}
904904
};
905905

906906
// Check for a non-const loan of `loan_path`
907-
let cont = this.each_in_scope_loan(assignment_id, |loan| {
907+
this.each_in_scope_loan(assignment_id, |loan| {
908908
if loan.loan_path == loan_path {
909909
this.report_illegal_mutation(assignment_span, &*full_loan_path, loan);
910910
false
911911
} else {
912912
true
913913
}
914914
});
915-
916-
if !cont { return false }
917915
}
918916
}
919917
}

0 commit comments

Comments
 (0)