diff --git a/src/librustc/middle/borrowck/gather_loans/restrictions.rs b/src/librustc/middle/borrowck/gather_loans/restrictions.rs index d1e9a2c0a7475..a686084a4a2bc 100644 --- a/src/librustc/middle/borrowck/gather_loans/restrictions.rs +++ b/src/librustc/middle/borrowck/gather_loans/restrictions.rs @@ -70,18 +70,19 @@ impl<'a> RestrictionsContext<'a> { mc::cat_arg(local_id) => { // R-Variable, locally declared let lp = Rc::new(LpVar(local_id)); - SafeIf(lp.clone(), vec!(lp)) + SafeIf(lp.clone(), vec![lp]) } mc::cat_upvar(upvar_id, _) => { // R-Variable, captured into closure let lp = Rc::new(LpUpvar(upvar_id)); - SafeIf(lp.clone(), vec!(lp)) + SafeIf(lp.clone(), vec![lp]) } - mc::cat_copied_upvar(..) => { - // FIXME(#2152) allow mutation of upvars - Safe + mc::cat_copied_upvar(mc::CopiedUpvar { upvar_id, .. }) => { + // R-Variable, copied/moved into closure + let lp = Rc::new(LpVar(upvar_id)); + SafeIf(lp.clone(), vec![lp]) } mc::cat_downcast(cmt_base) => {