From 4584acdf4c5824e020c738f0c89e86021ac531c0 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Tue, 17 Dec 2013 20:55:33 +0800 Subject: [PATCH] s/Second borrow/Previous borrow/ in error messages. When a borrow occurs twice illegally, Rust will label the other borrow as the "second borrow". This is quite confusing, as the "second borrow" usually happened before the flagged borrow (e.g. as far as dataflow is concerned, the first borrow is OK, the second borrow is illegal.) This patch renames "second borrow" to "previous borrow", to make the spatial relationship between the two borrows clearer. Signed-off-by: Edward Z. Yang --- src/librustc/middle/borrowck/check_loans.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustc/middle/borrowck/check_loans.rs b/src/librustc/middle/borrowck/check_loans.rs index 6d4450ec2e0..13c45cc8e36 100644 --- a/src/librustc/middle/borrowck/check_loans.rs +++ b/src/librustc/middle/borrowck/check_loans.rs @@ -238,7 +238,7 @@ impl<'a> CheckLoanCtxt<'a> { self.bccx.loan_path_to_str(new_loan.loan_path))); self.bccx.span_note( old_loan.span, - format!("second borrow of `{}` as mutable occurs here", + format!("previous borrow of `{}` as mutable occurs here", self.bccx.loan_path_to_str(new_loan.loan_path))); return false; } @@ -253,7 +253,7 @@ impl<'a> CheckLoanCtxt<'a> { self.bccx.mut_to_str(old_loan.mutbl))); self.bccx.span_note( old_loan.span, - format!("second borrow of `{}` occurs here", + format!("previous borrow of `{}` occurs here", self.bccx.loan_path_to_str(new_loan.loan_path))); return false; }