@@ -102,7 +102,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
102102 } ;
103103
104104 let funclet_br =
105- |this : & mut Self , bx : & Bx , target : mir:: BasicBlock | {
105+ |this : & mut Self , bx : & mut Bx , target : mir:: BasicBlock | {
106106 let ( lltarget, is_cleanupret) = lltarget ( this, target) ;
107107 if is_cleanupret {
108108 // micro-optimization: generate a `ret` rather than a jump
@@ -115,7 +115,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
115115
116116 let do_call = |
117117 this : & mut Self ,
118- bx : & Bx ,
118+ bx : & mut Bx ,
119119 fn_ty : FnType < ' tcx , Ty < ' tcx > > ,
120120 fn_ptr : Cx :: Value ,
121121 llargs : & [ Cx :: Value ] ,
@@ -191,7 +191,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
191191 }
192192
193193 mir:: TerminatorKind :: Goto { target } => {
194- funclet_br ( self , & bx, target) ;
194+ funclet_br ( self , & mut bx, target) ;
195195 }
196196
197197 mir:: TerminatorKind :: SwitchInt { ref discr, switch_ty, ref values, ref targets } => {
@@ -293,7 +293,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
293293
294294 if let ty:: InstanceDef :: DropGlue ( _, None ) = drop_fn. def {
295295 // we don't actually need to drop anything.
296- funclet_br ( self , & bx, target) ;
296+ funclet_br ( self , & mut bx, target) ;
297297 return
298298 }
299299
@@ -324,7 +324,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
324324 bx. cx ( ) . fn_type_of_instance ( & drop_fn) )
325325 }
326326 } ;
327- do_call ( self , & bx, fn_ty, drop_fn, args,
327+ do_call ( self , & mut bx, fn_ty, drop_fn, args,
328328 Some ( ( ReturnDest :: Nothing , target) ) ,
329329 unwind) ;
330330 }
@@ -348,7 +348,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
348348
349349 // Don't codegen the panic block if success if known.
350350 if const_cond == Some ( expected) {
351- funclet_br ( self , & bx, target) ;
351+ funclet_br ( self , & mut bx, target) ;
352352 return ;
353353 }
354354
@@ -419,7 +419,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
419419 let llfn = bx. cx ( ) . get_fn ( instance) ;
420420
421421 // Codegen the actual panic invoke/call.
422- do_call ( self , & bx, fn_ty, llfn, & args, None , cleanup) ;
422+ do_call ( self , & mut bx, fn_ty, llfn, & args, None , cleanup) ;
423423 }
424424
425425 mir:: TerminatorKind :: DropAndReplace { .. } => {
@@ -469,7 +469,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
469469 if let Some ( destination_ref) = destination. as_ref ( ) {
470470 let & ( ref dest, target) = destination_ref;
471471 self . codegen_transmute ( & bx, & args[ 0 ] , dest) ;
472- funclet_br ( self , & bx, target) ;
472+ funclet_br ( self , & mut bx, target) ;
473473 } else {
474474 // If we are trying to transmute to an uninhabited type,
475475 // it is likely there is no allotted destination. In fact,
@@ -496,7 +496,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
496496 Some ( ty:: InstanceDef :: DropGlue ( _, None ) ) => {
497497 // empty drop glue - a nop.
498498 let & ( _, target) = destination. as_ref ( ) . unwrap ( ) ;
499- funclet_br ( self , & bx, target) ;
499+ funclet_br ( self , & mut bx, target) ;
500500 return ;
501501 }
502502 _ => bx. cx ( ) . new_fn_type ( sig, & extra_args)
@@ -542,7 +542,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
542542 // Codegen the actual panic invoke/call.
543543 do_call (
544544 self ,
545- & bx,
545+ & mut bx,
546546 fn_ty,
547547 llfn,
548548 & [ msg_file_line_col] ,
@@ -640,7 +640,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
640640 }
641641
642642 if let Some ( ( _, target) ) = * destination {
643- funclet_br ( self , & bx, target) ;
643+ funclet_br ( self , & mut bx, target) ;
644644 } else {
645645 bx. unreachable ( ) ;
646646 }
@@ -692,7 +692,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
692692 _ => span_bug ! ( span, "no llfn for call" ) ,
693693 } ;
694694
695- do_call ( self , & bx, fn_ty, fn_ptr, & llargs,
695+ do_call ( self , & mut bx, fn_ty, fn_ptr, & llargs,
696696 destination. as_ref ( ) . map ( |& ( _, target) | ( ret_dest, target) ) ,
697697 cleanup) ;
698698 }
@@ -864,7 +864,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
864864 span_bug ! ( self . mir. span, "landing pad was not inserted?" )
865865 }
866866
867- let bx : Bx = self . new_block ( "cleanup" ) ;
867+ let mut bx : Bx = self . new_block ( "cleanup" ) ;
868868
869869 let llpersonality = self . cx . eh_personality ( ) ;
870870 let llretty = self . landing_pad_type ( ) ;
@@ -903,7 +903,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
903903 & self ,
904904 bb : mir:: BasicBlock
905905 ) -> Bx {
906- let bx = Bx :: with_cx ( self . cx ) ;
906+ let mut bx = Bx :: with_cx ( self . cx ) ;
907907 bx. position_at_end ( self . blocks [ bb] ) ;
908908 bx
909909 }
0 commit comments