]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/middle/trans/closure.rs
Fix panic due to overly long borrow of RefCell
[rust.git] / src / librustc / middle / trans / closure.rs
index 16db4daba46b8ba767aa99ebef481f1f192dfcfc..8c73baf2b677057e6331e8445becb8e515b29582 100644 (file)
@@ -482,10 +482,9 @@ pub fn trans_unboxed_closure<'blk, 'tcx>(
         bcx,
         closure_id).unwrap();
 
-    let unboxed_closures = bcx.tcx().unboxed_closures.borrow();
-    let function_type = (*unboxed_closures)[closure_id]
-                                        .closure_type
-                                        .clone();
+    let function_type = (*bcx.tcx().unboxed_closures.borrow())[closure_id]
+                                                              .closure_type
+                                                              .clone();
     let function_type = ty::mk_closure(bcx.tcx(), function_type);
 
     let freevars: Vec<ty::Freevar> =