diff options
| author | Cameron Zwarich <zwarich@mozilla.com> | 2014-06-16 15:40:20 -0700 |
|---|---|---|
| committer | Cameron Zwarich <zwarich@mozilla.com> | 2014-06-16 15:40:20 -0700 |
| commit | 178c4fbccbc59fc7c554cb3cda33413d7d455366 (patch) | |
| tree | f00a1c2b5e59043957e7524e7cb80514f9f4d18e /src | |
| parent | 702ef1b7215e310a0c5e2e761bef922f36dd5f65 (diff) | |
| download | rust-178c4fbccbc59fc7c554cb3cda33413d7d455366.tar.gz rust-178c4fbccbc59fc7c554cb3cda33413d7d455366.zip | |
Remove an unused return value
The only caller of check_for_assignment_to_restricted_or_frozen_location isn't checking its return value, so we can remove it and simplify the internal logic of the function.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc/middle/borrowck/check_loans.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/librustc/middle/borrowck/check_loans.rs b/src/librustc/middle/borrowck/check_loans.rs index ac8b0867f7a..42712206c01 100644 --- a/src/librustc/middle/borrowck/check_loans.rs +++ b/src/librustc/middle/borrowck/check_loans.rs @@ -825,14 +825,14 @@ impl<'a> CheckLoanCtxt<'a> { this: &CheckLoanCtxt, assignment_id: ast::NodeId, assignment_span: Span, - assignee_cmt: mc::cmt) -> bool + assignee_cmt: mc::cmt) { //! Check for assignments that violate the terms of an //! outstanding loan. let loan_path = match opt_loan_path(&assignee_cmt) { Some(lp) => lp, - None => { return true; /* no loan path, can't be any loans */ } + None => { return; /* no loan path, can't be any loans */ } }; // Start by searching for an assignment to a *restricted* @@ -852,7 +852,7 @@ impl<'a> CheckLoanCtxt<'a> { false }); - if !cont { return false } + if !cont { return; } // The previous code handled assignments to paths that // have been restricted. This covers paths that have been @@ -899,12 +899,12 @@ impl<'a> CheckLoanCtxt<'a> { LpExtend(_, mc::McDeclared, _) | LpExtend(_, mc::McImmutable, _) | LpVar(_) => { - return true; + return; } }; // Check for a non-const loan of `loan_path` - let cont = this.each_in_scope_loan(assignment_id, |loan| { + this.each_in_scope_loan(assignment_id, |loan| { if loan.loan_path == loan_path { this.report_illegal_mutation(assignment_span, &*full_loan_path, loan); false @@ -912,8 +912,6 @@ impl<'a> CheckLoanCtxt<'a> { true } }); - - if !cont { return false } } } } |
