diff --git a/src/librustc_borrowck/borrowck/fragments.rs b/src/librustc_borrowck/borrowck/fragments.rs index 070ae1151aa6..90da8906a6fa 100644 --- a/src/librustc_borrowck/borrowck/fragments.rs +++ b/src/librustc_borrowck/borrowck/fragments.rs @@ -44,7 +44,7 @@ enum Fragment { impl Fragment { fn loan_path_repr<'tcx>(&self, move_data: &MoveData<'tcx>, tcx: &ty::ctxt<'tcx>) -> String { - let repr = |mpi| move_data.path_loan_path(mpi).repr(tcx); + let repr = |&: mpi| move_data.path_loan_path(mpi).repr(tcx); match *self { Just(mpi) => repr(mpi), AllButOneFrom(mpi) => format!("$(allbutone {})", repr(mpi)), @@ -54,7 +54,7 @@ impl Fragment { fn loan_path_user_string<'tcx>(&self, move_data: &MoveData<'tcx>, tcx: &ty::ctxt<'tcx>) -> String { - let user_string = |mpi| move_data.path_loan_path(mpi).user_string(tcx); + let user_string = |&: mpi| move_data.path_loan_path(mpi).user_string(tcx); match *self { Just(mpi) => user_string(mpi), AllButOneFrom(mpi) => format!("$(allbutone {})", user_string(mpi)), @@ -140,9 +140,9 @@ pub fn instrument_move_fragments<'tcx>(this: &MoveData<'tcx>, if !span_err && !print { return; } - let instrument_all_paths = |kind, vec_rc: &Vec| { + let instrument_all_paths = |&: kind, vec_rc: &Vec| { for (i, mpi) in vec_rc.iter().enumerate() { - let render = || this.path_loan_path(*mpi).user_string(tcx); + let render = |&:| this.path_loan_path(*mpi).user_string(tcx); if span_err { tcx.sess.span_err(sp, format!("{}: `{}`", kind, render())[]); } @@ -152,9 +152,9 @@ pub fn instrument_move_fragments<'tcx>(this: &MoveData<'tcx>, } }; - let instrument_all_fragments = |kind, vec_rc: &Vec| { + let instrument_all_fragments = |&: kind, vec_rc: &Vec| { for (i, f) in vec_rc.iter().enumerate() { - let render = || f.loan_path_user_string(this, tcx); + let render = |&:| f.loan_path_user_string(this, tcx); if span_err { tcx.sess.span_err(sp, format!("{}: `{}`", kind, render())[]); } @@ -187,11 +187,11 @@ pub fn fixup_fragment_sets<'tcx>(this: &MoveData<'tcx>, tcx: &ty::ctxt<'tcx>) { let mut moved = mem::replace(&mut fragments.moved_leaf_paths, vec![]); let mut assigned = mem::replace(&mut fragments.assigned_leaf_paths, vec![]); - let path_lps = |mpis: &[MovePathIndex]| -> Vec { + let path_lps = |&: mpis: &[MovePathIndex]| -> Vec { mpis.iter().map(|mpi| this.path_loan_path(*mpi).repr(tcx)).collect() }; - let frag_lps = |fs: &[Fragment]| -> Vec { + let frag_lps = |&: fs: &[Fragment]| -> Vec { fs.iter().map(|f| f.loan_path_repr(this, tcx)).collect() }; @@ -344,7 +344,7 @@ fn add_fragment_siblings_for_extension<'tcx>(this: &MoveData<'tcx>, Rc>)>) { let parent_ty = parent_lp.to_type(); - let add_fragment_sibling_local = |field_name, variant_did| { + let mut add_fragment_sibling_local = |&mut : field_name, variant_did| { add_fragment_sibling_core( this, tcx, gathered_fragments, parent_lp.clone(), mc, field_name, origin_lp, variant_did); diff --git a/src/librustc_borrowck/borrowck/gather_loans/restrictions.rs b/src/librustc_borrowck/borrowck/gather_loans/restrictions.rs index b3fb7123ef3a..ad31c52ca34f 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/restrictions.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/restrictions.rs @@ -58,7 +58,7 @@ impl<'a, 'tcx> RestrictionsContext<'a, 'tcx> { cmt: mc::cmt<'tcx>) -> RestrictionResult<'tcx> { debug!("restrict(cmt={})", cmt.repr(self.bccx.tcx)); - let new_lp = |v: LoanPathKind<'tcx>| Rc::new(LoanPath::new(v, cmt.ty)); + let new_lp = |&: v: LoanPathKind<'tcx>| Rc::new(LoanPath::new(v, cmt.ty)); match cmt.cat.clone() { mc::cat_rvalue(..) => { diff --git a/src/librustc_borrowck/borrowck/mod.rs b/src/librustc_borrowck/borrowck/mod.rs index b57b76d66f71..c27b7b30e134 100644 --- a/src/librustc_borrowck/borrowck/mod.rs +++ b/src/librustc_borrowck/borrowck/mod.rs @@ -431,7 +431,7 @@ pub fn opt_loan_path<'tcx>(cmt: &mc::cmt<'tcx>) -> Option>> { //! which allows it to share common loan path pieces as it //! traverses the CMT. - let new_lp = |v: LoanPathKind<'tcx>| Rc::new(LoanPath::new(v, cmt.ty)); + let new_lp = |&: v: LoanPathKind<'tcx>| Rc::new(LoanPath::new(v, cmt.ty)); match cmt.cat { mc::cat_rvalue(..) |