@@ -4,7 +4,7 @@ use rustc_hir::lang_items::FnMutTraitLangItem;
4
4
use rustc_middle:: mir:: * ;
5
5
use rustc_middle:: ty:: query:: Providers ;
6
6
use rustc_middle:: ty:: subst:: { InternalSubsts , Subst } ;
7
- use rustc_middle:: ty:: { self , Ty , TyCtxt , TypeFoldable } ;
7
+ use rustc_middle:: ty:: { self , Ty , TyCtxt } ;
8
8
use rustc_target:: abi:: VariantIdx ;
9
9
10
10
use rustc_index:: vec:: { Idx , IndexVec } ;
@@ -36,11 +36,6 @@ fn make_shim<'tcx>(tcx: TyCtxt<'tcx>, instance: ty::InstanceDef<'tcx>) -> Body<'
36
36
build_call_shim ( tcx, instance, Some ( Adjustment :: Deref ) , CallKind :: Direct ( def_id) , None )
37
37
}
38
38
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
-
44
39
let trait_ = tcx. trait_of_item ( def_id) . unwrap ( ) ;
45
40
let adjustment = match tcx. fn_trait_kind_from_lang_item ( trait_) {
46
41
Some ( ty:: ClosureKind :: FnOnce ) => Adjustment :: Identity ,
@@ -83,22 +78,8 @@ fn make_shim<'tcx>(tcx: TyCtxt<'tcx>, instance: ty::InstanceDef<'tcx>) -> Body<'
83
78
None ,
84
79
)
85
80
}
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) ,
102
83
ty:: InstanceDef :: Virtual ( ..) => {
103
84
bug ! ( "InstanceDef::Virtual ({:?}) is for direct calls only" , instance)
104
85
}
0 commit comments