]> git.lizzy.rs Git - rust.git/commitdiff
Fix panic due to overly long borrow of RefCell
authorBrian Koropoff <bkoropoff@gmail.com>
Fri, 7 Nov 2014 03:31:56 +0000 (19:31 -0800)
committerBrian Koropoff <bkoropoff@gmail.com>
Fri, 7 Nov 2014 03:31:56 +0000 (19:31 -0800)
Closes #18711

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> =