@@ -37,17 +37,17 @@ enum MergingSucc {
37
37
38
38
/// Used by `FunctionCx::codegen_terminator` for emitting common patterns
39
39
/// e.g., creating a basic block, calling a function, etc.
40
- struct TerminatorCodegenHelper < ' tcx > {
40
+ struct TerminatorCodegenHelper < ' mir , ' tcx > {
41
41
bb : mir:: BasicBlock ,
42
- terminator : & ' tcx mir:: Terminator < ' tcx > ,
42
+ terminator : & ' mir mir:: Terminator < ' tcx > ,
43
43
}
44
44
45
- impl < ' a , ' tcx > TerminatorCodegenHelper < ' tcx > {
45
+ impl < ' a , ' tcx > TerminatorCodegenHelper < ' _ , ' tcx > {
46
46
/// Returns the appropriate `Funclet` for the current funclet, if on MSVC,
47
47
/// either already previously cached, or newly created, by `landing_pad_for`.
48
48
fn funclet < ' b , Bx : BuilderMethods < ' a , ' tcx > > (
49
49
& self ,
50
- fx : & ' b mut FunctionCx < ' a , ' tcx , Bx > ,
50
+ fx : & ' b mut FunctionCx < ' a , ' _ , ' tcx , Bx > ,
51
51
) -> Option < & ' b Bx :: Funclet > {
52
52
let cleanup_kinds = fx. cleanup_kinds . as_ref ( ) ?;
53
53
let funclet_bb = cleanup_kinds[ self . bb ] . funclet_bb ( self . bb ) ?;
@@ -73,7 +73,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
73
73
/// stuff in it or next to it.
74
74
fn llbb_with_cleanup < Bx : BuilderMethods < ' a , ' tcx > > (
75
75
& self ,
76
- fx : & mut FunctionCx < ' a , ' tcx , Bx > ,
76
+ fx : & mut FunctionCx < ' a , ' _ , ' tcx , Bx > ,
77
77
target : mir:: BasicBlock ,
78
78
) -> Bx :: BasicBlock {
79
79
let ( needs_landing_pad, is_cleanupret) = self . llbb_characteristics ( fx, target) ;
@@ -97,7 +97,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
97
97
98
98
fn llbb_characteristics < Bx : BuilderMethods < ' a , ' tcx > > (
99
99
& self ,
100
- fx : & mut FunctionCx < ' a , ' tcx , Bx > ,
100
+ fx : & mut FunctionCx < ' a , ' _ , ' tcx , Bx > ,
101
101
target : mir:: BasicBlock ,
102
102
) -> ( bool , bool ) {
103
103
if let Some ( ref cleanup_kinds) = fx. cleanup_kinds {
@@ -122,7 +122,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
122
122
123
123
fn funclet_br < Bx : BuilderMethods < ' a , ' tcx > > (
124
124
& self ,
125
- fx : & mut FunctionCx < ' a , ' tcx , Bx > ,
125
+ fx : & mut FunctionCx < ' a , ' _ , ' tcx , Bx > ,
126
126
bx : & mut Bx ,
127
127
target : mir:: BasicBlock ,
128
128
mergeable_succ : bool ,
@@ -151,7 +151,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
151
151
/// return destination `destination` and the unwind action `unwind`.
152
152
fn do_call < Bx : BuilderMethods < ' a , ' tcx > > (
153
153
& self ,
154
- fx : & mut FunctionCx < ' a , ' tcx , Bx > ,
154
+ fx : & mut FunctionCx < ' a , ' _ , ' tcx , Bx > ,
155
155
bx : & mut Bx ,
156
156
fn_abi : & ' tcx FnAbi < ' tcx , Ty < ' tcx > > ,
157
157
fn_ptr : Bx :: Value ,
@@ -274,7 +274,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
274
274
/// Generates inline assembly with optional `destination` and `unwind`.
275
275
fn do_inlineasm < Bx : BuilderMethods < ' a , ' tcx > > (
276
276
& self ,
277
- fx : & mut FunctionCx < ' a , ' tcx , Bx > ,
277
+ fx : & mut FunctionCx < ' a , ' _ , ' tcx , Bx > ,
278
278
bx : & mut Bx ,
279
279
template : & [ InlineAsmTemplatePiece ] ,
280
280
operands : & [ InlineAsmOperandRef < ' tcx , Bx > ] ,
@@ -341,9 +341,13 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
341
341
}
342
342
343
343
/// 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 > {
345
345
/// 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
+ ) {
347
351
if let Some ( funclet) = helper. funclet ( self ) {
348
352
bx. cleanup_ret ( funclet, None ) ;
349
353
} else {
@@ -360,7 +364,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
360
364
361
365
fn codegen_switchint_terminator (
362
366
& mut self ,
363
- helper : TerminatorCodegenHelper < ' tcx > ,
367
+ helper : TerminatorCodegenHelper < ' _ , ' tcx > ,
364
368
bx : & mut Bx ,
365
369
discr : & mir:: Operand < ' tcx > ,
366
370
targets : & SwitchTargets ,
@@ -567,7 +571,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
567
571
#[ tracing:: instrument( level = "trace" , skip( self , helper, bx) ) ]
568
572
fn codegen_drop_terminator (
569
573
& mut self ,
570
- helper : TerminatorCodegenHelper < ' tcx > ,
574
+ helper : TerminatorCodegenHelper < ' _ , ' tcx > ,
571
575
bx : & mut Bx ,
572
576
source_info : & mir:: SourceInfo ,
573
577
location : mir:: Place < ' tcx > ,
@@ -576,7 +580,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
576
580
mergeable_succ : bool ,
577
581
) -> MergingSucc {
578
582
let ty = location. ty ( self . mir , bx. tcx ( ) ) . ty ;
579
- let ty = self . monomorphize ( ty) ;
580
583
let drop_fn = Instance :: resolve_drop_in_place ( bx. tcx ( ) , ty) ;
581
584
582
585
if let ty:: InstanceKind :: DropGlue ( _, None ) = drop_fn. def {
@@ -665,7 +668,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
665
668
666
669
fn codegen_assert_terminator (
667
670
& mut self ,
668
- helper : TerminatorCodegenHelper < ' tcx > ,
671
+ helper : TerminatorCodegenHelper < ' _ , ' tcx > ,
669
672
bx : & mut Bx ,
670
673
terminator : & mir:: Terminator < ' tcx > ,
671
674
cond : & mir:: Operand < ' tcx > ,
@@ -755,7 +758,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
755
758
756
759
fn codegen_terminate_terminator (
757
760
& mut self ,
758
- helper : TerminatorCodegenHelper < ' tcx > ,
761
+ helper : TerminatorCodegenHelper < ' _ , ' tcx > ,
759
762
bx : & mut Bx ,
760
763
terminator : & mir:: Terminator < ' tcx > ,
761
764
reason : UnwindTerminateReason ,
@@ -785,7 +788,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
785
788
/// Returns `Some` if this is indeed a panic intrinsic and codegen is done.
786
789
fn codegen_panic_intrinsic (
787
790
& mut self ,
788
- helper : & TerminatorCodegenHelper < ' tcx > ,
791
+ helper : & TerminatorCodegenHelper < ' _ , ' tcx > ,
789
792
bx : & mut Bx ,
790
793
intrinsic : ty:: IntrinsicDef ,
791
794
instance : Instance < ' tcx > ,
@@ -851,7 +854,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
851
854
852
855
fn codegen_call_terminator (
853
856
& mut self ,
854
- helper : TerminatorCodegenHelper < ' tcx > ,
857
+ helper : TerminatorCodegenHelper < ' _ , ' tcx > ,
855
858
bx : & mut Bx ,
856
859
terminator : & mir:: Terminator < ' tcx > ,
857
860
func : & mir:: Operand < ' tcx > ,
@@ -985,10 +988,9 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
985
988
let sig = callee. layout . ty . fn_sig ( bx. tcx ( ) ) ;
986
989
987
990
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
+ ) ;
992
994
993
995
let fn_abi = match instance {
994
996
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> {
1153
1155
1154
1156
fn codegen_asm_terminator (
1155
1157
& mut self ,
1156
- helper : TerminatorCodegenHelper < ' tcx > ,
1158
+ helper : TerminatorCodegenHelper < ' _ , ' tcx > ,
1157
1159
bx : & mut Bx ,
1158
1160
asm_macro : InlineAsmMacro ,
1159
1161
terminator : & mir:: Terminator < ' tcx > ,
@@ -1196,8 +1198,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1196
1198
InlineAsmOperandRef :: Const { string }
1197
1199
}
1198
1200
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 ( ) {
1201
1202
let instance = ty:: Instance :: resolve_for_fn_ptr (
1202
1203
bx. tcx ( ) ,
1203
1204
bx. typing_env ( ) ,
@@ -1287,7 +1288,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1287
1288
& mut self ,
1288
1289
bx : & mut Bx ,
1289
1290
bb : mir:: BasicBlock ,
1290
- terminator : & ' tcx mir:: Terminator < ' tcx > ,
1291
+ terminator : & mir:: Terminator < ' tcx > ,
1291
1292
) -> MergingSucc {
1292
1293
debug ! ( "codegen_terminator: {:?}" , terminator) ;
1293
1294
0 commit comments