@@ -204,7 +204,6 @@ enum SelectionCandidate<'tcx> {
204
204
ParamCandidate ( ty:: PolyTraitRef < ' tcx > ) ,
205
205
ImplCandidate ( DefId ) ,
206
206
DefaultImplCandidate ( DefId ) ,
207
- DefaultImplObjectCandidate ( DefId ) ,
208
207
209
208
/// This is a trait matching with a projected type as `Self`, and
210
209
/// we found an applicable bound in the trait definition.
@@ -237,9 +236,6 @@ impl<'a, 'tcx> ty::Lift<'tcx> for SelectionCandidate<'a> {
237
236
}
238
237
ImplCandidate ( def_id) => ImplCandidate ( def_id) ,
239
238
DefaultImplCandidate ( def_id) => DefaultImplCandidate ( def_id) ,
240
- DefaultImplObjectCandidate ( def_id) => {
241
- DefaultImplObjectCandidate ( def_id)
242
- }
243
239
ProjectionCandidate => ProjectionCandidate ,
244
240
FnPointerCandidate => FnPointerCandidate ,
245
241
ObjectCandidate => ObjectCandidate ,
@@ -1431,17 +1427,9 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
1431
1427
match self_ty. sty {
1432
1428
ty:: TyDynamic ( ..) => {
1433
1429
// For object types, we don't know what the closed
1434
- // over types are. For most traits, this means we
1435
- // conservatively say nothing; a candidate may be
1436
- // added by `assemble_candidates_from_object_ty`.
1437
- // However, for the kind of magic reflect trait,
1438
- // we consider it to be implemented even for
1439
- // object types, because it just lets you reflect
1440
- // onto the object type, not into the object's
1441
- // interior.
1442
- if self . tcx ( ) . has_attr ( def_id, "rustc_reflect_like" ) {
1443
- candidates. vec . push ( DefaultImplObjectCandidate ( def_id) ) ;
1444
- }
1430
+ // over types are. This means we conservatively
1431
+ // say nothing; a candidate may be added by
1432
+ // `assemble_candidates_from_object_ty`.
1445
1433
}
1446
1434
ty:: TyParam ( ..) |
1447
1435
ty:: TyProjection ( ..) |
@@ -1671,7 +1659,6 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
1671
1659
FnPointerCandidate |
1672
1660
BuiltinObjectCandidate |
1673
1661
BuiltinUnsizeCandidate |
1674
- DefaultImplObjectCandidate ( ..) |
1675
1662
BuiltinCandidate { .. } => {
1676
1663
// We have a where-clause so don't go around looking
1677
1664
// for impls.
@@ -1998,11 +1985,6 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
1998
1985
Ok ( VtableDefaultImpl ( data) )
1999
1986
}
2000
1987
2001
- DefaultImplObjectCandidate ( trait_def_id) => {
2002
- let data = self . confirm_default_impl_object_candidate ( obligation, trait_def_id) ;
2003
- Ok ( VtableDefaultImpl ( data) )
2004
- }
2005
-
2006
1988
ImplCandidate ( impl_def_id) => {
2007
1989
Ok ( VtableImpl ( self . confirm_impl_candidate ( obligation, impl_def_id) ) )
2008
1990
}
@@ -2138,42 +2120,6 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
2138
2120
self . vtable_default_impl ( obligation, trait_def_id, ty:: Binder ( types) )
2139
2121
}
2140
2122
2141
- fn confirm_default_impl_object_candidate ( & mut self ,
2142
- obligation : & TraitObligation < ' tcx > ,
2143
- trait_def_id : DefId )
2144
- -> VtableDefaultImplData < PredicateObligation < ' tcx > >
2145
- {
2146
- debug ! ( "confirm_default_impl_object_candidate({:?}, {:?})" ,
2147
- obligation,
2148
- trait_def_id) ;
2149
-
2150
- assert ! ( self . tcx( ) . has_attr( trait_def_id, "rustc_reflect_like" ) ) ;
2151
-
2152
- // OK to skip binder, it is reintroduced below
2153
- let self_ty = self . infcx . shallow_resolve ( obligation. predicate . skip_binder ( ) . self_ty ( ) ) ;
2154
- match self_ty. sty {
2155
- ty:: TyDynamic ( ref data, ..) => {
2156
- // OK to skip the binder, it is reintroduced below
2157
- let principal = data. principal ( ) . unwrap ( ) ;
2158
- let input_types = principal. input_types ( ) ;
2159
- let assoc_types = data. projection_bounds ( )
2160
- . map ( |pb| pb. skip_binder ( ) . ty ) ;
2161
- let all_types: Vec < _ > = input_types. chain ( assoc_types)
2162
- . collect ( ) ;
2163
-
2164
- // reintroduce the two binding levels we skipped, then flatten into one
2165
- let all_types = ty:: Binder ( ty:: Binder ( all_types) ) ;
2166
- let all_types = self . tcx ( ) . flatten_late_bound_regions ( & all_types) ;
2167
-
2168
- self . vtable_default_impl ( obligation, trait_def_id, all_types)
2169
- }
2170
- _ => {
2171
- bug ! ( "asked to confirm default object implementation for non-object type: {:?}" ,
2172
- self_ty) ;
2173
- }
2174
- }
2175
- }
2176
-
2177
2123
/// See `confirm_default_impl_candidate`
2178
2124
fn vtable_default_impl ( & mut self ,
2179
2125
obligation : & TraitObligation < ' tcx > ,
0 commit comments