Skip to content

Commit

Permalink
Remove an unused closure parameter
Browse files Browse the repository at this point in the history
Remove the unused &Restriction parameter of each_in_scope_restriction's
op parameter.
  • Loading branch information
Cameron Zwarich committed Jun 16, 2014
1 parent 2d3f122 commit d2ca746
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/librustc/middle/borrowck/check_loans.rs
Expand Up @@ -192,7 +192,7 @@ impl<'a> CheckLoanCtxt<'a> {
pub fn each_in_scope_restriction(&self,
scope_id: ast::NodeId,
loan_path: &LoanPath,
op: |&Loan, &Restriction| -> bool)
op: |&Loan| -> bool)
-> bool {
//! Iterates through all the in-scope restrictions for the
//! given `loan_path`
Expand All @@ -204,7 +204,7 @@ impl<'a> CheckLoanCtxt<'a> {
let mut ret = true;
for restr in loan.restrictions.iter() {
if *restr.loan_path == *loan_path {
if !op(loan, restr) {
if !op(loan) {
ret = false;
break;
}
Expand Down Expand Up @@ -541,7 +541,7 @@ impl<'a> CheckLoanCtxt<'a> {
// let x = &mut a.b.c; // Restricts a, a.b, and a.b.c
// let y = a; // Conflicts with restriction

self.each_in_scope_restriction(expr_id, use_path, |loan, _restr| {
self.each_in_scope_restriction(expr_id, use_path, |loan| {
if incompatible(loan.kind, borrow_kind) {
ret = UseWhileBorrowed(loan.loan_path.clone(), loan.span);
false
Expand Down Expand Up @@ -833,7 +833,7 @@ impl<'a> CheckLoanCtxt<'a> {

let cont = this.each_in_scope_restriction(assignment_id,
&*loan_path,
|loan, _restr| {
|loan| {
this.report_illegal_mutation(assignment_span, &*loan_path, loan);
false
});
Expand Down

0 comments on commit d2ca746

Please sign in to comment.