@@ -824,7 +824,6 @@ fn should_encode_span(def_kind: DefKind) -> bool {
824
824
| DefKind :: AnonConst
825
825
| DefKind :: InlineConst
826
826
| DefKind :: OpaqueTy
827
- | DefKind :: ImplTraitPlaceholder
828
827
| DefKind :: Field
829
828
| DefKind :: Impl { .. }
830
829
| DefKind :: Closure
@@ -867,7 +866,6 @@ fn should_encode_attrs(def_kind: DefKind) -> bool {
867
866
| DefKind :: AnonConst
868
867
| DefKind :: InlineConst
869
868
| DefKind :: OpaqueTy
870
- | DefKind :: ImplTraitPlaceholder
871
869
| DefKind :: LifetimeParam
872
870
| DefKind :: GlobalAsm
873
871
| DefKind :: Generator => false ,
@@ -902,7 +900,6 @@ fn should_encode_expn_that_defined(def_kind: DefKind) -> bool {
902
900
| DefKind :: AnonConst
903
901
| DefKind :: InlineConst
904
902
| DefKind :: OpaqueTy
905
- | DefKind :: ImplTraitPlaceholder
906
903
| DefKind :: Field
907
904
| DefKind :: LifetimeParam
908
905
| DefKind :: GlobalAsm
@@ -939,7 +936,6 @@ fn should_encode_visibility(def_kind: DefKind) -> bool {
939
936
| DefKind :: AnonConst
940
937
| DefKind :: InlineConst
941
938
| DefKind :: OpaqueTy
942
- | DefKind :: ImplTraitPlaceholder
943
939
| DefKind :: GlobalAsm
944
940
| DefKind :: Impl { .. }
945
941
| DefKind :: Closure
@@ -966,7 +962,6 @@ fn should_encode_stability(def_kind: DefKind) -> bool {
966
962
| DefKind :: ForeignMod
967
963
| DefKind :: TyAlias
968
964
| DefKind :: OpaqueTy
969
- | DefKind :: ImplTraitPlaceholder
970
965
| DefKind :: Enum
971
966
| DefKind :: Union
972
967
| DefKind :: Impl { .. }
@@ -1033,7 +1028,6 @@ fn should_encode_variances(def_kind: DefKind) -> bool {
1033
1028
| DefKind :: Enum
1034
1029
| DefKind :: Variant
1035
1030
| DefKind :: OpaqueTy
1036
- | DefKind :: ImplTraitPlaceholder
1037
1031
| DefKind :: Fn
1038
1032
| DefKind :: Ctor ( ..)
1039
1033
| DefKind :: AssocFn => true ,
@@ -1083,7 +1077,6 @@ fn should_encode_generics(def_kind: DefKind) -> bool {
1083
1077
| DefKind :: AnonConst
1084
1078
| DefKind :: InlineConst
1085
1079
| DefKind :: OpaqueTy
1086
- | DefKind :: ImplTraitPlaceholder
1087
1080
| DefKind :: Impl { .. }
1088
1081
| DefKind :: Field
1089
1082
| DefKind :: TyParam
@@ -1134,19 +1127,6 @@ fn should_encode_type(tcx: TyCtxt<'_>, def_id: LocalDefId, def_kind: DefKind) ->
1134
1127
}
1135
1128
}
1136
1129
1137
- DefKind :: ImplTraitPlaceholder => {
1138
- let parent_def_id = tcx. impl_trait_in_trait_parent_fn ( def_id. to_def_id ( ) ) ;
1139
- let assoc_item = tcx. associated_item ( parent_def_id) ;
1140
- match assoc_item. container {
1141
- // Always encode an RPIT in an impl fn, since it always has a body
1142
- ty:: AssocItemContainer :: ImplContainer => true ,
1143
- ty:: AssocItemContainer :: TraitContainer => {
1144
- // Encode an RPIT for a trait only if the trait has a default body
1145
- assoc_item. defaultness ( tcx) . has_value ( )
1146
- }
1147
- }
1148
- }
1149
-
1150
1130
DefKind :: AssocTy => {
1151
1131
let assoc_item = tcx. associated_item ( def_id) ;
1152
1132
match assoc_item. container {
@@ -1192,7 +1172,6 @@ fn should_encode_fn_sig(def_kind: DefKind) -> bool {
1192
1172
| DefKind :: Ctor ( ..)
1193
1173
| DefKind :: TyAlias
1194
1174
| DefKind :: OpaqueTy
1195
- | DefKind :: ImplTraitPlaceholder
1196
1175
| DefKind :: ForeignTy
1197
1176
| DefKind :: Impl { .. }
1198
1177
| DefKind :: AssocConst
@@ -1235,7 +1214,6 @@ fn should_encode_constness(def_kind: DefKind) -> bool {
1235
1214
| DefKind :: TyAlias
1236
1215
| DefKind :: OpaqueTy
1237
1216
| DefKind :: Impl { of_trait : false }
1238
- | DefKind :: ImplTraitPlaceholder
1239
1217
| DefKind :: ForeignTy
1240
1218
| DefKind :: Generator
1241
1219
| DefKind :: ConstParam
@@ -1268,7 +1246,6 @@ fn should_encode_const(def_kind: DefKind) -> bool {
1268
1246
| DefKind :: Static ( ..)
1269
1247
| DefKind :: TyAlias
1270
1248
| DefKind :: OpaqueTy
1271
- | DefKind :: ImplTraitPlaceholder
1272
1249
| DefKind :: ForeignTy
1273
1250
| DefKind :: Impl { .. }
1274
1251
| DefKind :: AssocFn
@@ -1289,11 +1266,8 @@ fn should_encode_const(def_kind: DefKind) -> bool {
1289
1266
}
1290
1267
}
1291
1268
1292
- // We only encode impl trait in trait when using `lower-impl-trait-in-trait-to-assoc-ty` unstable
1293
- // option.
1294
1269
fn should_encode_fn_impl_trait_in_trait < ' tcx > ( tcx : TyCtxt < ' tcx > , def_id : DefId ) -> bool {
1295
- if tcx. lower_impl_trait_in_trait_to_assoc_ty ( )
1296
- && let Some ( assoc_item) = tcx. opt_associated_item ( def_id)
1270
+ if let Some ( assoc_item) = tcx. opt_associated_item ( def_id)
1297
1271
&& assoc_item. container == ty:: AssocItemContainer :: TraitContainer
1298
1272
&& assoc_item. kind == ty:: AssocKind :: Fn
1299
1273
{
@@ -1447,9 +1421,6 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
1447
1421
. is_type_alias_impl_trait
1448
1422
. set ( def_id. index , self . tcx . is_type_alias_impl_trait ( def_id) ) ;
1449
1423
}
1450
- if let DefKind :: ImplTraitPlaceholder = def_kind {
1451
- self . encode_explicit_item_bounds ( def_id) ;
1452
- }
1453
1424
if tcx. impl_method_has_trait_impl_trait_tys ( def_id)
1454
1425
&& let Ok ( table) = self . tcx . collect_return_position_impl_trait_in_trait_tys ( def_id)
1455
1426
{
0 commit comments