From 2d3f1225342760bcf986d0a7d3945ddacce47ab2 Mon Sep 17 00:00:00 2001 From: Cameron Zwarich Date: Mon, 16 Jun 2014 15:40:20 -0700 Subject: [PATCH] Remove a pointless check for intersection with RESTR_MUTATE Now that all loans restrict mutation, there's no point in checking for intersection with RESTR_MUTATE. --- src/librustc/middle/borrowck/check_loans.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/librustc/middle/borrowck/check_loans.rs b/src/librustc/middle/borrowck/check_loans.rs index 077bb99e21b6..969a8c139a4b 100644 --- a/src/librustc/middle/borrowck/check_loans.rs +++ b/src/librustc/middle/borrowck/check_loans.rs @@ -833,13 +833,9 @@ impl<'a> CheckLoanCtxt<'a> { let cont = this.each_in_scope_restriction(assignment_id, &*loan_path, - |loan, restr| { - if restr.set.intersects(RESTR_MUTATE) { - this.report_illegal_mutation(assignment_span, &*loan_path, loan); - false - } else { - true - } + |loan, _restr| { + this.report_illegal_mutation(assignment_span, &*loan_path, loan); + false }); if !cont { return false }