@@ -111,7 +111,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
111111 } ;
112112
113113 let funclet_br =
114- |this : & mut Self , bx : & Bx , target : mir:: BasicBlock | {
114+ |this : & mut Self , bx : & mut Bx , target : mir:: BasicBlock | {
115115 let ( lltarget, is_cleanupret) = lltarget ( this, target) ;
116116 if is_cleanupret {
117117 // micro-optimization: generate a `ret` rather than a jump
@@ -124,7 +124,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
124124
125125 let do_call = |
126126 this : & mut Self ,
127- bx : & Bx ,
127+ bx : & mut Bx ,
128128 fn_ty : FnType < ' tcx , Ty < ' tcx > > ,
129129 fn_ptr : Bx :: Value ,
130130 llargs : & [ Bx :: Value ] ,
@@ -200,7 +200,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
200200 }
201201
202202 mir:: TerminatorKind :: Goto { target } => {
203- funclet_br ( self , & bx, target) ;
203+ funclet_br ( self , & mut bx, target) ;
204204 }
205205
206206 mir:: TerminatorKind :: SwitchInt { ref discr, switch_ty, ref values, ref targets } => {
@@ -302,7 +302,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
302302
303303 if let ty:: InstanceDef :: DropGlue ( _, None ) = drop_fn. def {
304304 // we don't actually need to drop anything.
305- funclet_br ( self , & bx, target) ;
305+ funclet_br ( self , & mut bx, target) ;
306306 return
307307 }
308308
@@ -332,7 +332,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
332332 bx. cx ( ) . fn_type_of_instance ( & drop_fn) )
333333 }
334334 } ;
335- do_call ( self , & bx, fn_ty, drop_fn, args,
335+ do_call ( self , & mut bx, fn_ty, drop_fn, args,
336336 Some ( ( ReturnDest :: Nothing , target) ) ,
337337 unwind) ;
338338 }
@@ -356,7 +356,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
356356
357357 // Don't codegen the panic block if success if known.
358358 if const_cond == Some ( expected) {
359- funclet_br ( self , & bx, target) ;
359+ funclet_br ( self , & mut bx, target) ;
360360 return ;
361361 }
362362
@@ -427,7 +427,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
427427 let llfn = bx. cx ( ) . get_fn ( instance) ;
428428
429429 // Codegen the actual panic invoke/call.
430- do_call ( self , & bx, fn_ty, llfn, & args, None , cleanup) ;
430+ do_call ( self , & mut bx, fn_ty, llfn, & args, None , cleanup) ;
431431 }
432432
433433 mir:: TerminatorKind :: DropAndReplace { .. } => {
@@ -477,7 +477,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
477477 if let Some ( destination_ref) = destination. as_ref ( ) {
478478 let & ( ref dest, target) = destination_ref;
479479 self . codegen_transmute ( & bx, & args[ 0 ] , dest) ;
480- funclet_br ( self , & bx, target) ;
480+ funclet_br ( self , & mut bx, target) ;
481481 } else {
482482 // If we are trying to transmute to an uninhabited type,
483483 // it is likely there is no allotted destination. In fact,
@@ -504,7 +504,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
504504 Some ( ty:: InstanceDef :: DropGlue ( _, None ) ) => {
505505 // empty drop glue - a nop.
506506 let & ( _, target) = destination. as_ref ( ) . unwrap ( ) ;
507- funclet_br ( self , & bx, target) ;
507+ funclet_br ( self , & mut bx, target) ;
508508 return ;
509509 }
510510 _ => bx. cx ( ) . new_fn_type ( sig, & extra_args)
@@ -550,7 +550,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
550550 // Codegen the actual panic invoke/call.
551551 do_call (
552552 self ,
553- & bx,
553+ & mut bx,
554554 fn_ty,
555555 llfn,
556556 & [ msg_file_line_col] ,
@@ -648,7 +648,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
648648 }
649649
650650 if let Some ( ( _, target) ) = * destination {
651- funclet_br ( self , & bx, target) ;
651+ funclet_br ( self , & mut bx, target) ;
652652 } else {
653653 bx. unreachable ( ) ;
654654 }
@@ -740,7 +740,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
740740 _ => span_bug ! ( span, "no llfn for call" ) ,
741741 } ;
742742
743- do_call ( self , & bx, fn_ty, fn_ptr, & llargs,
743+ do_call ( self , & mut bx, fn_ty, fn_ptr, & llargs,
744744 destination. as_ref ( ) . map ( |& ( _, target) | ( ret_dest, target) ) ,
745745 cleanup) ;
746746 }
@@ -913,7 +913,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
913913 span_bug ! ( self . mir. span, "landing pad was not inserted?" )
914914 }
915915
916- let bx = self . new_block ( "cleanup" ) ;
916+ let mut bx = self . new_block ( "cleanup" ) ;
917917
918918 let llpersonality = self . cx . eh_personality ( ) ;
919919 let llretty = self . landing_pad_type ( ) ;
@@ -952,7 +952,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
952952 & self ,
953953 bb : mir:: BasicBlock
954954 ) -> Bx {
955- let bx = Bx :: with_cx ( self . cx ) ;
955+ let mut bx = Bx :: with_cx ( self . cx ) ;
956956 bx. position_at_end ( self . blocks [ bb] ) ;
957957 bx
958958 }
0 commit comments