]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_borrowck/borrowck/gather_loans/mod.rs
Auto merge of #35856 - phimuemue:master, r=brson
[rust.git] / src / librustc_borrowck / borrowck / gather_loans / mod.rs
index c982fc091d24c0d8ddebce581190335a86635ca8..a255564f01e255397f0c8a538e28df1c3d906096 100644 (file)
@@ -130,7 +130,7 @@ fn borrow(&mut self,
               borrow_id: ast::NodeId,
               borrow_span: Span,
               cmt: mc::cmt<'tcx>,
-              loan_region: ty::Region,
+              loan_region: &'tcx ty::Region,
               bk: ty::BorrowKind,
               loan_cause: euv::LoanCause)
     {
@@ -307,7 +307,7 @@ fn guarantee_valid(&mut self,
                        borrow_span: Span,
                        cmt: mc::cmt<'tcx>,
                        req_kind: ty::BorrowKind,
-                       loan_region: ty::Region,
+                       loan_region: &'tcx ty::Region,
                        cause: euv::LoanCause) {
         debug!("guarantee_valid(borrow_id={}, cmt={:?}, \
                 req_mutbl={:?}, loan_region={:?})",
@@ -318,7 +318,7 @@ fn guarantee_valid(&mut self,
 
         // a loan for the empty region can never be dereferenced, so
         // it is always safe
-        if loan_region == ty::ReEmpty {
+        if *loan_region == ty::ReEmpty {
             return;
         }
 
@@ -358,7 +358,7 @@ fn guarantee_valid(&mut self,
             }
 
             RestrictionResult::SafeIf(loan_path, restricted_paths) => {
-                let loan_scope = match loan_region {
+                let loan_scope = match *loan_region {
                     ty::ReScope(scope) => scope,
 
                     ty::ReFree(ref fr) => fr.scope,