@@ -13,7 +13,7 @@ use check::regionck::RegionCtxt;
13
13
14
14
use hir:: def_id:: DefId ;
15
15
use middle:: free_region:: FreeRegionMap ;
16
- use rustc:: infer;
16
+ use rustc:: infer:: { self , InferOk } ;
17
17
use middle:: region;
18
18
use rustc:: ty:: subst:: { Subst , Substs } ;
19
19
use rustc:: ty:: { self , AdtKind , Ty , TyCtxt } ;
@@ -93,16 +93,22 @@ fn ensure_drop_params_and_item_params_correspond<'a, 'tcx>(
93
93
infcx. fresh_substs_for_item ( drop_impl_span, drop_impl_did) ;
94
94
let fresh_impl_self_ty = drop_impl_ty. subst ( tcx, fresh_impl_substs) ;
95
95
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
+ }
106
112
}
107
113
108
114
if let Err ( ref errors) = fulfillment_cx. select_all_or_error ( & infcx) {
0 commit comments