@@ -37,17 +37,17 @@ enum MergingSucc {
3737
3838/// Used by `FunctionCx::codegen_terminator` for emitting common patterns
3939/// e.g., creating a basic block, calling a function, etc.
40- struct TerminatorCodegenHelper < ' tcx > {
40+ struct TerminatorCodegenHelper < ' mir , ' tcx > {
4141 bb : mir:: BasicBlock ,
42- terminator : & ' tcx mir:: Terminator < ' tcx > ,
42+ terminator : & ' mir mir:: Terminator < ' tcx > ,
4343}
4444
45- impl < ' a , ' tcx > TerminatorCodegenHelper < ' tcx > {
45+ impl < ' a , ' tcx > TerminatorCodegenHelper < ' _ , ' tcx > {
4646 /// Returns the appropriate `Funclet` for the current funclet, if on MSVC,
4747 /// either already previously cached, or newly created, by `landing_pad_for`.
4848 fn funclet < ' b , Bx : BuilderMethods < ' a , ' tcx > > (
4949 & self ,
50- fx : & ' b mut FunctionCx < ' a , ' tcx , Bx > ,
50+ fx : & ' b mut FunctionCx < ' a , ' _ , ' tcx , Bx > ,
5151 ) -> Option < & ' b Bx :: Funclet > {
5252 let cleanup_kinds = fx. cleanup_kinds . as_ref ( ) ?;
5353 let funclet_bb = cleanup_kinds[ self . bb ] . funclet_bb ( self . bb ) ?;
@@ -73,7 +73,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
7373 /// stuff in it or next to it.
7474 fn llbb_with_cleanup < Bx : BuilderMethods < ' a , ' tcx > > (
7575 & self ,
76- fx : & mut FunctionCx < ' a , ' tcx , Bx > ,
76+ fx : & mut FunctionCx < ' a , ' _ , ' tcx , Bx > ,
7777 target : mir:: BasicBlock ,
7878 ) -> Bx :: BasicBlock {
7979 let ( needs_landing_pad, is_cleanupret) = self . llbb_characteristics ( fx, target) ;
@@ -97,7 +97,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
9797
9898 fn llbb_characteristics < Bx : BuilderMethods < ' a , ' tcx > > (
9999 & self ,
100- fx : & mut FunctionCx < ' a , ' tcx , Bx > ,
100+ fx : & mut FunctionCx < ' a , ' _ , ' tcx , Bx > ,
101101 target : mir:: BasicBlock ,
102102 ) -> ( bool , bool ) {
103103 if let Some ( ref cleanup_kinds) = fx. cleanup_kinds {
@@ -122,7 +122,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
122122
123123 fn funclet_br < Bx : BuilderMethods < ' a , ' tcx > > (
124124 & self ,
125- fx : & mut FunctionCx < ' a , ' tcx , Bx > ,
125+ fx : & mut FunctionCx < ' a , ' _ , ' tcx , Bx > ,
126126 bx : & mut Bx ,
127127 target : mir:: BasicBlock ,
128128 mergeable_succ : bool ,
@@ -151,7 +151,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
151151 /// return destination `destination` and the unwind action `unwind`.
152152 fn do_call < Bx : BuilderMethods < ' a , ' tcx > > (
153153 & self ,
154- fx : & mut FunctionCx < ' a , ' tcx , Bx > ,
154+ fx : & mut FunctionCx < ' a , ' _ , ' tcx , Bx > ,
155155 bx : & mut Bx ,
156156 fn_abi : & ' tcx FnAbi < ' tcx , Ty < ' tcx > > ,
157157 fn_ptr : Bx :: Value ,
@@ -274,7 +274,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
274274 /// Generates inline assembly with optional `destination` and `unwind`.
275275 fn do_inlineasm < Bx : BuilderMethods < ' a , ' tcx > > (
276276 & self ,
277- fx : & mut FunctionCx < ' a , ' tcx , Bx > ,
277+ fx : & mut FunctionCx < ' a , ' _ , ' tcx , Bx > ,
278278 bx : & mut Bx ,
279279 template : & [ InlineAsmTemplatePiece ] ,
280280 operands : & [ InlineAsmOperandRef < ' tcx , Bx > ] ,
@@ -341,9 +341,13 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
341341}
342342
343343/// Codegen implementations for some terminator variants.
344- impl < ' a , ' tcx , Bx : BuilderMethods < ' a , ' tcx > > FunctionCx < ' a , ' tcx , Bx > {
344+ impl < ' a , ' tcx , Bx : BuilderMethods < ' a , ' tcx > > FunctionCx < ' a , ' _ , ' tcx , Bx > {
345345 /// Generates code for a `Resume` terminator.
346- fn codegen_resume_terminator ( & mut self , helper : TerminatorCodegenHelper < ' tcx > , bx : & mut Bx ) {
346+ fn codegen_resume_terminator (
347+ & mut self ,
348+ helper : TerminatorCodegenHelper < ' _ , ' tcx > ,
349+ bx : & mut Bx ,
350+ ) {
347351 if let Some ( funclet) = helper. funclet ( self ) {
348352 bx. cleanup_ret ( funclet, None ) ;
349353 } else {
@@ -360,7 +364,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
360364
361365 fn codegen_switchint_terminator (
362366 & mut self ,
363- helper : TerminatorCodegenHelper < ' tcx > ,
367+ helper : TerminatorCodegenHelper < ' _ , ' tcx > ,
364368 bx : & mut Bx ,
365369 discr : & mir:: Operand < ' tcx > ,
366370 targets : & SwitchTargets ,
@@ -567,7 +571,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
567571 #[ tracing:: instrument( level = "trace" , skip( self , helper, bx) ) ]
568572 fn codegen_drop_terminator (
569573 & mut self ,
570- helper : TerminatorCodegenHelper < ' tcx > ,
574+ helper : TerminatorCodegenHelper < ' _ , ' tcx > ,
571575 bx : & mut Bx ,
572576 source_info : & mir:: SourceInfo ,
573577 location : mir:: Place < ' tcx > ,
@@ -576,7 +580,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
576580 mergeable_succ : bool ,
577581 ) -> MergingSucc {
578582 let ty = location. ty ( self . mir , bx. tcx ( ) ) . ty ;
579- let ty = self . monomorphize ( ty) ;
580583 let drop_fn = Instance :: resolve_drop_in_place ( bx. tcx ( ) , ty) ;
581584
582585 if let ty:: InstanceKind :: DropGlue ( _, None ) = drop_fn. def {
@@ -665,7 +668,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
665668
666669 fn codegen_assert_terminator (
667670 & mut self ,
668- helper : TerminatorCodegenHelper < ' tcx > ,
671+ helper : TerminatorCodegenHelper < ' _ , ' tcx > ,
669672 bx : & mut Bx ,
670673 terminator : & mir:: Terminator < ' tcx > ,
671674 cond : & mir:: Operand < ' tcx > ,
@@ -755,7 +758,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
755758
756759 fn codegen_terminate_terminator (
757760 & mut self ,
758- helper : TerminatorCodegenHelper < ' tcx > ,
761+ helper : TerminatorCodegenHelper < ' _ , ' tcx > ,
759762 bx : & mut Bx ,
760763 terminator : & mir:: Terminator < ' tcx > ,
761764 reason : UnwindTerminateReason ,
@@ -785,7 +788,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
785788 /// Returns `Some` if this is indeed a panic intrinsic and codegen is done.
786789 fn codegen_panic_intrinsic (
787790 & mut self ,
788- helper : & TerminatorCodegenHelper < ' tcx > ,
791+ helper : & TerminatorCodegenHelper < ' _ , ' tcx > ,
789792 bx : & mut Bx ,
790793 intrinsic : ty:: IntrinsicDef ,
791794 instance : Instance < ' tcx > ,
@@ -851,7 +854,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
851854
852855 fn codegen_call_terminator (
853856 & mut self ,
854- helper : TerminatorCodegenHelper < ' tcx > ,
857+ helper : TerminatorCodegenHelper < ' _ , ' tcx > ,
855858 bx : & mut Bx ,
856859 terminator : & mir:: Terminator < ' tcx > ,
857860 func : & mir:: Operand < ' tcx > ,
@@ -985,10 +988,9 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
985988 let sig = callee. layout . ty . fn_sig ( bx. tcx ( ) ) ;
986989
987990 let extra_args = & args[ sig. inputs ( ) . skip_binder ( ) . len ( ) ..] ;
988- let extra_args = bx. tcx ( ) . mk_type_list_from_iter ( extra_args. iter ( ) . map ( |op_arg| {
989- let op_ty = op_arg. node . ty ( self . mir , bx. tcx ( ) ) ;
990- self . monomorphize ( op_ty)
991- } ) ) ;
991+ let extra_args = bx. tcx ( ) . mk_type_list_from_iter (
992+ extra_args. iter ( ) . map ( |op_arg| op_arg. node . ty ( self . mir , bx. tcx ( ) ) ) ,
993+ ) ;
992994
993995 let fn_abi = match instance {
994996 Some ( instance) => bx. fn_abi_of_instance ( instance, extra_args) ,
@@ -1153,7 +1155,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
11531155
11541156 fn codegen_asm_terminator (
11551157 & mut self ,
1156- helper : TerminatorCodegenHelper < ' tcx > ,
1158+ helper : TerminatorCodegenHelper < ' _ , ' tcx > ,
11571159 bx : & mut Bx ,
11581160 asm_macro : InlineAsmMacro ,
11591161 terminator : & mir:: Terminator < ' tcx > ,
@@ -1196,8 +1198,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
11961198 InlineAsmOperandRef :: Const { string }
11971199 }
11981200 mir:: InlineAsmOperand :: SymFn { ref value } => {
1199- let const_ = self . monomorphize ( value. const_ ) ;
1200- if let ty:: FnDef ( def_id, args) = * const_. ty ( ) . kind ( ) {
1201+ if let ty:: FnDef ( def_id, args) = * value. const_ . ty ( ) . kind ( ) {
12011202 let instance = ty:: Instance :: resolve_for_fn_ptr (
12021203 bx. tcx ( ) ,
12031204 bx. typing_env ( ) ,
@@ -1287,7 +1288,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
12871288 & mut self ,
12881289 bx : & mut Bx ,
12891290 bb : mir:: BasicBlock ,
1290- terminator : & ' tcx mir:: Terminator < ' tcx > ,
1291+ terminator : & mir:: Terminator < ' tcx > ,
12911292 ) -> MergingSucc {
12921293 debug ! ( "codegen_terminator: {:?}" , terminator) ;
12931294
0 commit comments