@@ -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
@@ -323,7 +323,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
323323 bx. cx ( ) . fn_type_of_instance ( & drop_fn) )
324324 }
325325 } ;
326- do_call ( self , & bx, fn_ty, drop_fn, args,
326+ do_call ( self , & mut bx, fn_ty, drop_fn, args,
327327 Some ( ( ReturnDest :: Nothing , target) ) ,
328328 unwind) ;
329329 }
@@ -347,7 +347,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
347347
348348 // Don't codegen the panic block if success if known.
349349 if const_cond == Some ( expected) {
350- funclet_br ( self , & bx, target) ;
350+ funclet_br ( self , & mut bx, target) ;
351351 return ;
352352 }
353353
@@ -418,7 +418,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
418418 let llfn = bx. cx ( ) . get_fn ( instance) ;
419419
420420 // Codegen the actual panic invoke/call.
421- do_call ( self , & bx, fn_ty, llfn, & args, None , cleanup) ;
421+ do_call ( self , & mut bx, fn_ty, llfn, & args, None , cleanup) ;
422422 }
423423
424424 mir:: TerminatorKind :: DropAndReplace { .. } => {
@@ -468,7 +468,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
468468 if let Some ( destination_ref) = destination. as_ref ( ) {
469469 let & ( ref dest, target) = destination_ref;
470470 self . codegen_transmute ( & bx, & args[ 0 ] , dest) ;
471- funclet_br ( self , & bx, target) ;
471+ funclet_br ( self , & mut bx, target) ;
472472 } else {
473473 // If we are trying to transmute to an uninhabited type,
474474 // it is likely there is no allotted destination. In fact,
@@ -495,7 +495,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
495495 Some ( ty:: InstanceDef :: DropGlue ( _, None ) ) => {
496496 // empty drop glue - a nop.
497497 let & ( _, target) = destination. as_ref ( ) . unwrap ( ) ;
498- funclet_br ( self , & bx, target) ;
498+ funclet_br ( self , & mut bx, target) ;
499499 return ;
500500 }
501501 _ => bx. cx ( ) . new_fn_type ( sig, & extra_args)
@@ -541,7 +541,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
541541 // Codegen the actual panic invoke/call.
542542 do_call (
543543 self ,
544- & bx,
544+ & mut bx,
545545 fn_ty,
546546 llfn,
547547 & [ msg_file_line_col] ,
@@ -639,7 +639,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
639639 }
640640
641641 if let Some ( ( _, target) ) = * destination {
642- funclet_br ( self , & bx, target) ;
642+ funclet_br ( self , & mut bx, target) ;
643643 } else {
644644 bx. unreachable ( ) ;
645645 }
@@ -731,7 +731,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
731731 _ => span_bug ! ( span, "no llfn for call" ) ,
732732 } ;
733733
734- do_call ( self , & bx, fn_ty, fn_ptr, & llargs,
734+ do_call ( self , & mut bx, fn_ty, fn_ptr, & llargs,
735735 destination. as_ref ( ) . map ( |& ( _, target) | ( ret_dest, target) ) ,
736736 cleanup) ;
737737 }
@@ -903,7 +903,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
903903 span_bug ! ( self . mir. span, "landing pad was not inserted?" )
904904 }
905905
906- let bx : Bx = self . new_block ( "cleanup" ) ;
906+ let mut bx : Bx = self . new_block ( "cleanup" ) ;
907907
908908 let llpersonality = self . cx . eh_personality ( ) ;
909909 let llretty = self . landing_pad_type ( ) ;
@@ -942,7 +942,7 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
942942 & self ,
943943 bb : mir:: BasicBlock
944944 ) -> Bx {
945- let bx = Bx :: with_cx ( self . cx ) ;
945+ let mut bx = Bx :: with_cx ( self . cx ) ;
946946 bx. position_at_end ( self . blocks [ bb] ) ;
947947 bx
948948 }
0 commit comments