@@ -171,7 +171,7 @@ fn build_drop_shim<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, ty: Option<Ty<'tcx>>)
171
171
block ( & mut blocks, TerminatorKind :: Goto { target : return_block } ) ;
172
172
block ( & mut blocks, TerminatorKind :: Return ) ;
173
173
174
- let source = MirSource :: from_instance ( ty:: InstanceDef :: DropGlue ( def_id, ty) ) ;
174
+ let source = ty:: InstanceDef :: DropGlue ( def_id, ty) ;
175
175
let mut body =
176
176
new_body ( source, blocks, local_decls_for_sig ( & sig, span) , sig. inputs ( ) . len ( ) , span) ;
177
177
@@ -229,7 +229,7 @@ fn build_drop_shim<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, ty: Option<Ty<'tcx>>)
229
229
}
230
230
231
231
fn new_body < ' tcx > (
232
- source : MirSource < ' tcx > ,
232
+ source : ty :: InstanceDef < ' tcx > ,
233
233
basic_blocks : IndexVec < BasicBlock , BasicBlockData < ' tcx > > ,
234
234
local_decls : IndexVec < Local , LocalDecl < ' tcx > > ,
235
235
arg_count : usize ,
@@ -343,7 +343,7 @@ fn build_thread_local_shim<'tcx>(tcx: TyCtxt<'tcx>, instance: ty::InstanceDef<'t
343
343
} ) ;
344
344
345
345
new_body (
346
- MirSource :: from_instance ( instance) ,
346
+ instance,
347
347
blocks,
348
348
IndexVec :: from_raw ( vec ! [ LocalDecl :: new( tcx. thread_local_ptr_ty( def_id) , span) ] ) ,
349
349
0 ,
@@ -407,10 +407,7 @@ impl<'tcx> CloneShimBuilder<'tcx> {
407
407
}
408
408
409
409
fn into_mir ( self ) -> Body < ' tcx > {
410
- let source = MirSource :: from_instance ( ty:: InstanceDef :: CloneShim (
411
- self . def_id ,
412
- self . sig . inputs_and_output [ 0 ] ,
413
- ) ) ;
410
+ let source = ty:: InstanceDef :: CloneShim ( self . def_id , self . sig . inputs_and_output [ 0 ] ) ;
414
411
new_body ( source, self . blocks , self . local_decls , self . sig . inputs ( ) . len ( ) , self . span )
415
412
}
416
413
@@ -823,8 +820,7 @@ fn build_call_shim<'tcx>(
823
820
block ( & mut blocks, vec ! [ ] , TerminatorKind :: Resume , true ) ;
824
821
}
825
822
826
- let mut body =
827
- new_body ( MirSource :: from_instance ( instance) , blocks, local_decls, sig. inputs ( ) . len ( ) , span) ;
823
+ let mut body = new_body ( instance, blocks, local_decls, sig. inputs ( ) . len ( ) , span) ;
828
824
829
825
if let Abi :: RustCall = sig. abi {
830
826
body. spread_arg = Some ( Local :: new ( sig. inputs ( ) . len ( ) ) ) ;
@@ -890,7 +886,7 @@ pub fn build_adt_ctor(tcx: TyCtxt<'_>, ctor_id: DefId) -> Body<'_> {
890
886
is_cleanup : false ,
891
887
} ;
892
888
893
- let source = MirSource :: item ( ctor_id) ;
889
+ let source = ty :: InstanceDef :: Item ( ctor_id) ;
894
890
let body = new_body (
895
891
source,
896
892
IndexVec :: from_elem_n ( start_block, 1 ) ,
@@ -936,6 +932,6 @@ fn build_fn_ptr_addr_shim<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, self_ty: Ty<'t
936
932
terminator : Some ( Terminator { source_info, kind : TerminatorKind :: Return } ) ,
937
933
is_cleanup : false ,
938
934
} ;
939
- let source = MirSource :: from_instance ( ty:: InstanceDef :: FnPtrAddrShim ( def_id, self_ty) ) ;
935
+ let source = ty:: InstanceDef :: FnPtrAddrShim ( def_id, self_ty) ;
940
936
new_body ( source, IndexVec :: from_elem_n ( start_block, 1 ) , locals, sig. inputs ( ) . len ( ) , span)
941
937
}
0 commit comments