Skip to content

Commit 2d3f122

Browse files
author
Cameron Zwarich
committed
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.
1 parent 2f77212 commit 2d3f122

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/librustc/middle/borrowck/check_loans.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -833,13 +833,9 @@ impl<'a> CheckLoanCtxt<'a> {
833833

834834
let cont = this.each_in_scope_restriction(assignment_id,
835835
&*loan_path,
836-
|loan, restr| {
837-
if restr.set.intersects(RESTR_MUTATE) {
838-
this.report_illegal_mutation(assignment_span, &*loan_path, loan);
839-
false
840-
} else {
841-
true
842-
}
836+
|loan, _restr| {
837+
this.report_illegal_mutation(assignment_span, &*loan_path, loan);
838+
false
843839
});
844840

845841
if !cont { return false }

0 commit comments

Comments
 (0)