@@ -4,7 +4,7 @@ use rustc_hir::lang_items::FnMutTraitLangItem;
44use rustc_middle:: mir:: * ;
55use rustc_middle:: ty:: query:: Providers ;
66use rustc_middle:: ty:: subst:: { InternalSubsts , Subst } ;
7- use rustc_middle:: ty:: { self , Ty , TyCtxt , TypeFoldable } ;
7+ use rustc_middle:: ty:: { self , Ty , TyCtxt } ;
88use rustc_target:: abi:: VariantIdx ;
99
1010use rustc_index:: vec:: { Idx , IndexVec } ;
@@ -36,11 +36,6 @@ fn make_shim<'tcx>(tcx: TyCtxt<'tcx>, instance: ty::InstanceDef<'tcx>) -> Body<'
3636 build_call_shim ( tcx, instance, Some ( Adjustment :: Deref ) , CallKind :: Direct ( def_id) , None )
3737 }
3838 ty:: InstanceDef :: FnPtrShim ( def_id, ty) => {
39- // FIXME(eddyb) support generating shims for a "shallow type",
40- // e.g. `Foo<_>` or `[_]` instead of requiring a fully monomorphic
41- // `Foo<Bar>` or `[String]` etc.
42- assert ! ( !ty. needs_subst( ) ) ;
43-
4439 let trait_ = tcx. trait_of_item ( def_id) . unwrap ( ) ;
4540 let adjustment = match tcx. fn_trait_kind_from_lang_item ( trait_) {
4641 Some ( ty:: ClosureKind :: FnOnce ) => Adjustment :: Identity ,
@@ -83,22 +78,8 @@ fn make_shim<'tcx>(tcx: TyCtxt<'tcx>, instance: ty::InstanceDef<'tcx>) -> Body<'
8378 None ,
8479 )
8580 }
86- ty:: InstanceDef :: DropGlue ( def_id, ty) => {
87- // FIXME(eddyb) support generating shims for a "shallow type",
88- // e.g. `Foo<_>` or `[_]` instead of requiring a fully monomorphic
89- // `Foo<Bar>` or `[String]` etc.
90- assert ! ( !ty. needs_subst( ) ) ;
91-
92- build_drop_shim ( tcx, def_id, ty)
93- }
94- ty:: InstanceDef :: CloneShim ( def_id, ty) => {
95- // FIXME(eddyb) support generating shims for a "shallow type",
96- // e.g. `Foo<_>` or `[_]` instead of requiring a fully monomorphic
97- // `Foo<Bar>` or `[String]` etc.
98- assert ! ( !ty. needs_subst( ) ) ;
99-
100- build_clone_shim ( tcx, def_id, ty)
101- }
81+ ty:: InstanceDef :: DropGlue ( def_id, ty) => build_drop_shim ( tcx, def_id, ty) ,
82+ ty:: InstanceDef :: CloneShim ( def_id, ty) => build_clone_shim ( tcx, def_id, ty) ,
10283 ty:: InstanceDef :: Virtual ( ..) => {
10384 bug ! ( "InstanceDef::Virtual ({:?}) is for direct calls only" , instance)
10485 }
0 commit comments