@@ -13,7 +13,7 @@ use check::regionck::RegionCtxt;
1313
1414use hir:: def_id:: DefId ;
1515use middle:: free_region:: FreeRegionMap ;
16- use rustc:: infer;
16+ use rustc:: infer:: { self , InferOk } ;
1717use middle:: region;
1818use rustc:: ty:: subst:: { Subst , Substs } ;
1919use rustc:: ty:: { self , AdtKind , Ty , TyCtxt } ;
@@ -93,16 +93,22 @@ fn ensure_drop_params_and_item_params_correspond<'a, 'tcx>(
9393 infcx. fresh_substs_for_item ( drop_impl_span, drop_impl_did) ;
9494 let fresh_impl_self_ty = drop_impl_ty. subst ( tcx, fresh_impl_substs) ;
9595
96- if let Err ( _) = infcx. eq_types ( true , infer:: TypeOrigin :: Misc ( drop_impl_span) ,
97- named_type, fresh_impl_self_ty) {
98- let item_span = tcx. map . span ( self_type_node_id) ;
99- struct_span_err ! ( tcx. sess, drop_impl_span, E0366 ,
100- "Implementations of Drop cannot be specialized" )
101- . span_note ( item_span,
102- "Use same sequence of generic type and region \
103- parameters that is on the struct/enum definition")
104- . emit ( ) ;
105- return Err ( ( ) ) ;
96+ match infcx. eq_types ( true , infer:: TypeOrigin :: Misc ( drop_impl_span) ,
97+ named_type, fresh_impl_self_ty) {
98+ Ok ( InferOk { obligations, .. } ) => {
99+ // FIXME(#32730) propagate obligations
100+ assert ! ( obligations. is_empty( ) ) ;
101+ }
102+ Err ( _) => {
103+ let item_span = tcx. map . span ( self_type_node_id) ;
104+ struct_span_err ! ( tcx. sess, drop_impl_span, E0366 ,
105+ "Implementations of Drop cannot be specialized" )
106+ . span_note ( item_span,
107+ "Use same sequence of generic type and region \
108+ parameters that is on the struct/enum definition")
109+ . emit ( ) ;
110+ return Err ( ( ) ) ;
111+ }
106112 }
107113
108114 if let Err ( ref errors) = fulfillment_cx. select_all_or_error ( & infcx) {
0 commit comments