about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc/middle/borrowck/gather_loans/restrictions.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/librustc/middle/borrowck/gather_loans/restrictions.rs b/src/librustc/middle/borrowck/gather_loans/restrictions.rs
index d1e9a2c0a74..a686084a4a2 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) => {