@@ -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 ,
@@ -270,7 +270,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
270
270
/// Generates inline assembly with optional `destination` and `unwind`.
271
271
fn do_inlineasm < Bx : BuilderMethods < ' a , ' tcx > > (
272
272
& self ,
273
- fx : & mut FunctionCx < ' a , ' tcx , Bx > ,
273
+ fx : & mut FunctionCx < ' a , ' _ , ' tcx , Bx > ,
274
274
bx : & mut Bx ,
275
275
template : & [ InlineAsmTemplatePiece ] ,
276
276
operands : & [ InlineAsmOperandRef < ' tcx , Bx > ] ,
@@ -337,9 +337,13 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
337
337
}
338
338
339
339
/// Codegen implementations for some terminator variants.
340
- impl < ' a , ' tcx , Bx : BuilderMethods < ' a , ' tcx > > FunctionCx < ' a , ' tcx , Bx > {
340
+ impl < ' a , ' tcx , Bx : BuilderMethods < ' a , ' tcx > > FunctionCx < ' a , ' _ , ' tcx , Bx > {
341
341
/// Generates code for a `Resume` terminator.
342
- fn codegen_resume_terminator ( & mut self , helper : TerminatorCodegenHelper < ' tcx > , bx : & mut Bx ) {
342
+ fn codegen_resume_terminator (
343
+ & mut self ,
344
+ helper : TerminatorCodegenHelper < ' _ , ' tcx > ,
345
+ bx : & mut Bx ,
346
+ ) {
343
347
if let Some ( funclet) = helper. funclet ( self ) {
344
348
bx. cleanup_ret ( funclet, None ) ;
345
349
} else {
@@ -356,7 +360,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
356
360
357
361
fn codegen_switchint_terminator (
358
362
& mut self ,
359
- helper : TerminatorCodegenHelper < ' tcx > ,
363
+ helper : TerminatorCodegenHelper < ' _ , ' tcx > ,
360
364
bx : & mut Bx ,
361
365
discr : & mir:: Operand < ' tcx > ,
362
366
targets : & SwitchTargets ,
@@ -496,7 +500,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
496
500
#[ tracing:: instrument( level = "trace" , skip( self , helper, bx) ) ]
497
501
fn codegen_drop_terminator (
498
502
& mut self ,
499
- helper : TerminatorCodegenHelper < ' tcx > ,
503
+ helper : TerminatorCodegenHelper < ' _ , ' tcx > ,
500
504
bx : & mut Bx ,
501
505
source_info : & mir:: SourceInfo ,
502
506
location : mir:: Place < ' tcx > ,
@@ -505,7 +509,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
505
509
mergeable_succ : bool ,
506
510
) -> MergingSucc {
507
511
let ty = location. ty ( self . mir , bx. tcx ( ) ) . ty ;
508
- let ty = self . monomorphize ( ty) ;
509
512
let drop_fn = Instance :: resolve_drop_in_place ( bx. tcx ( ) , ty) ;
510
513
511
514
if let ty:: InstanceKind :: DropGlue ( _, None ) = drop_fn. def {
@@ -638,7 +641,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
638
641
639
642
fn codegen_assert_terminator (
640
643
& mut self ,
641
- helper : TerminatorCodegenHelper < ' tcx > ,
644
+ helper : TerminatorCodegenHelper < ' _ , ' tcx > ,
642
645
bx : & mut Bx ,
643
646
terminator : & mir:: Terminator < ' tcx > ,
644
647
cond : & mir:: Operand < ' tcx > ,
@@ -717,7 +720,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
717
720
718
721
fn codegen_terminate_terminator (
719
722
& mut self ,
720
- helper : TerminatorCodegenHelper < ' tcx > ,
723
+ helper : TerminatorCodegenHelper < ' _ , ' tcx > ,
721
724
bx : & mut Bx ,
722
725
terminator : & mir:: Terminator < ' tcx > ,
723
726
reason : UnwindTerminateReason ,
@@ -747,7 +750,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
747
750
/// Returns `Some` if this is indeed a panic intrinsic and codegen is done.
748
751
fn codegen_panic_intrinsic (
749
752
& mut self ,
750
- helper : & TerminatorCodegenHelper < ' tcx > ,
753
+ helper : & TerminatorCodegenHelper < ' _ , ' tcx > ,
751
754
bx : & mut Bx ,
752
755
intrinsic : ty:: IntrinsicDef ,
753
756
instance : Option < Instance < ' tcx > > ,
@@ -815,7 +818,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
815
818
816
819
fn codegen_call_terminator (
817
820
& mut self ,
818
- helper : TerminatorCodegenHelper < ' tcx > ,
821
+ helper : TerminatorCodegenHelper < ' _ , ' tcx > ,
819
822
bx : & mut Bx ,
820
823
terminator : & mir:: Terminator < ' tcx > ,
821
824
func : & mir:: Operand < ' tcx > ,
@@ -868,10 +871,9 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
868
871
let abi = sig. abi ( ) ;
869
872
870
873
let extra_args = & args[ sig. inputs ( ) . skip_binder ( ) . len ( ) ..] ;
871
- let extra_args = bx. tcx ( ) . mk_type_list_from_iter ( extra_args. iter ( ) . map ( |op_arg| {
872
- let op_ty = op_arg. node . ty ( self . mir , bx. tcx ( ) ) ;
873
- self . monomorphize ( op_ty)
874
- } ) ) ;
874
+ let extra_args = bx. tcx ( ) . mk_type_list_from_iter (
875
+ extra_args. iter ( ) . map ( |op_arg| op_arg. node . ty ( self . mir , bx. tcx ( ) ) ) ,
876
+ ) ;
875
877
876
878
let fn_abi = match instance {
877
879
Some ( instance) => bx. fn_abi_of_instance ( instance, extra_args) ,
@@ -1154,7 +1156,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1154
1156
1155
1157
fn codegen_asm_terminator (
1156
1158
& mut self ,
1157
- helper : TerminatorCodegenHelper < ' tcx > ,
1159
+ helper : TerminatorCodegenHelper < ' _ , ' tcx > ,
1158
1160
bx : & mut Bx ,
1159
1161
terminator : & mir:: Terminator < ' tcx > ,
1160
1162
template : & [ ast:: InlineAsmTemplatePiece ] ,
@@ -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
ty:: ParamEnv :: reveal_all ( ) ,
@@ -1238,7 +1239,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1238
1239
}
1239
1240
}
1240
1241
1241
- impl < ' a , ' tcx , Bx : BuilderMethods < ' a , ' tcx > > FunctionCx < ' a , ' tcx , Bx > {
1242
+ impl < ' a , ' tcx , Bx : BuilderMethods < ' a , ' tcx > > FunctionCx < ' a , ' _ , ' tcx , Bx > {
1242
1243
pub fn codegen_block ( & mut self , mut bb : mir:: BasicBlock ) {
1243
1244
let llbb = match self . try_llbb ( bb) {
1244
1245
Some ( llbb) => llbb,
@@ -1293,7 +1294,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1293
1294
& mut self ,
1294
1295
bx : & mut Bx ,
1295
1296
bb : mir:: BasicBlock ,
1296
- terminator : & ' tcx mir:: Terminator < ' tcx > ,
1297
+ terminator : & mir:: Terminator < ' tcx > ,
1297
1298
) -> MergingSucc {
1298
1299
debug ! ( "codegen_terminator: {:?}" , terminator) ;
1299
1300
0 commit comments