@@ -204,7 +204,6 @@ enum SelectionCandidate<'tcx> {
204204 ParamCandidate ( ty:: PolyTraitRef < ' tcx > ) ,
205205 ImplCandidate ( DefId ) ,
206206 DefaultImplCandidate ( DefId ) ,
207- DefaultImplObjectCandidate ( DefId ) ,
208207
209208 /// This is a trait matching with a projected type as `Self`, and
210209 /// we found an applicable bound in the trait definition.
@@ -237,9 +236,6 @@ impl<'a, 'tcx> ty::Lift<'tcx> for SelectionCandidate<'a> {
237236 }
238237 ImplCandidate ( def_id) => ImplCandidate ( def_id) ,
239238 DefaultImplCandidate ( def_id) => DefaultImplCandidate ( def_id) ,
240- DefaultImplObjectCandidate ( def_id) => {
241- DefaultImplObjectCandidate ( def_id)
242- }
243239 ProjectionCandidate => ProjectionCandidate ,
244240 FnPointerCandidate => FnPointerCandidate ,
245241 ObjectCandidate => ObjectCandidate ,
@@ -1431,17 +1427,9 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
14311427 match self_ty. sty {
14321428 ty:: TyDynamic ( ..) => {
14331429 // 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`.
14451433 }
14461434 ty:: TyParam ( ..) |
14471435 ty:: TyProjection ( ..) |
@@ -1671,7 +1659,6 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
16711659 FnPointerCandidate |
16721660 BuiltinObjectCandidate |
16731661 BuiltinUnsizeCandidate |
1674- DefaultImplObjectCandidate ( ..) |
16751662 BuiltinCandidate { .. } => {
16761663 // We have a where-clause so don't go around looking
16771664 // for impls.
@@ -1998,11 +1985,6 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
19981985 Ok ( VtableDefaultImpl ( data) )
19991986 }
20001987
2001- DefaultImplObjectCandidate ( trait_def_id) => {
2002- let data = self . confirm_default_impl_object_candidate ( obligation, trait_def_id) ;
2003- Ok ( VtableDefaultImpl ( data) )
2004- }
2005-
20061988 ImplCandidate ( impl_def_id) => {
20071989 Ok ( VtableImpl ( self . confirm_impl_candidate ( obligation, impl_def_id) ) )
20081990 }
@@ -2138,42 +2120,6 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
21382120 self . vtable_default_impl ( obligation, trait_def_id, ty:: Binder ( types) )
21392121 }
21402122
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-
21772123 /// See `confirm_default_impl_candidate`
21782124 fn vtable_default_impl ( & mut self ,
21792125 obligation : & TraitObligation < ' tcx > ,
0 commit comments