Skip to content

Commit bb0a719

Browse files
committed
Fix panic due to overly long borrow of RefCell
Closes #18711
1 parent 45cbdec commit bb0a719

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/librustc/middle/trans/closure.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -482,10 +482,9 @@ pub fn trans_unboxed_closure<'blk, 'tcx>(
482482
bcx,
483483
closure_id).unwrap();
484484

485-
let unboxed_closures = bcx.tcx().unboxed_closures.borrow();
486-
let function_type = (*unboxed_closures)[closure_id]
487-
.closure_type
488-
.clone();
485+
let function_type = (*bcx.tcx().unboxed_closures.borrow())[closure_id]
486+
.closure_type
487+
.clone();
489488
let function_type = ty::mk_closure(bcx.tcx(), function_type);
490489

491490
let freevars: Vec<ty::Freevar> =

0 commit comments

Comments
 (0)