@@ -171,7 +171,7 @@ fn build_drop_shim<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, ty: Option<Ty<'tcx>>)
171171 block ( & mut blocks, TerminatorKind :: Goto { target : return_block } ) ;
172172 block ( & mut blocks, TerminatorKind :: Return ) ;
173173
174- let source = MirSource :: from_instance ( ty:: InstanceDef :: DropGlue ( def_id, ty) ) ;
174+ let source = ty:: InstanceDef :: DropGlue ( def_id, ty) ;
175175 let mut body =
176176 new_body ( source, blocks, local_decls_for_sig ( & sig, span) , sig. inputs ( ) . len ( ) , span) ;
177177
@@ -229,7 +229,7 @@ fn build_drop_shim<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, ty: Option<Ty<'tcx>>)
229229}
230230
231231fn new_body < ' tcx > (
232- source : MirSource < ' tcx > ,
232+ source : ty :: InstanceDef < ' tcx > ,
233233 basic_blocks : IndexVec < BasicBlock , BasicBlockData < ' tcx > > ,
234234 local_decls : IndexVec < Local , LocalDecl < ' tcx > > ,
235235 arg_count : usize ,
@@ -343,7 +343,7 @@ fn build_thread_local_shim<'tcx>(tcx: TyCtxt<'tcx>, instance: ty::InstanceDef<'t
343343 } ) ;
344344
345345 new_body (
346- MirSource :: from_instance ( instance) ,
346+ instance,
347347 blocks,
348348 IndexVec :: from_raw ( vec ! [ LocalDecl :: new( tcx. thread_local_ptr_ty( def_id) , span) ] ) ,
349349 0 ,
@@ -407,10 +407,7 @@ impl<'tcx> CloneShimBuilder<'tcx> {
407407 }
408408
409409 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 ] ) ;
414411 new_body ( source, self . blocks , self . local_decls , self . sig . inputs ( ) . len ( ) , self . span )
415412 }
416413
@@ -823,8 +820,7 @@ fn build_call_shim<'tcx>(
823820 block ( & mut blocks, vec ! [ ] , TerminatorKind :: Resume , true ) ;
824821 }
825822
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) ;
828824
829825 if let Abi :: RustCall = sig. abi {
830826 body. spread_arg = Some ( Local :: new ( sig. inputs ( ) . len ( ) ) ) ;
@@ -890,7 +886,7 @@ pub fn build_adt_ctor(tcx: TyCtxt<'_>, ctor_id: DefId) -> Body<'_> {
890886 is_cleanup : false ,
891887 } ;
892888
893- let source = MirSource :: item ( ctor_id) ;
889+ let source = ty :: InstanceDef :: Item ( ctor_id) ;
894890 let body = new_body (
895891 source,
896892 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
936932 terminator : Some ( Terminator { source_info, kind : TerminatorKind :: Return } ) ,
937933 is_cleanup : false ,
938934 } ;
939- let source = MirSource :: from_instance ( ty:: InstanceDef :: FnPtrAddrShim ( def_id, self_ty) ) ;
935+ let source = ty:: InstanceDef :: FnPtrAddrShim ( def_id, self_ty) ;
940936 new_body ( source, IndexVec :: from_elem_n ( start_block, 1 ) , locals, sig. inputs ( ) . len ( ) , span)
941937}
0 commit comments