File tree 1 file changed +6
-8
lines changed
compiler/rustc_borrowck/src/region_infer 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -263,13 +263,11 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
263
263
264
264
// Require that the hidden type actually fulfills all the bounds of the opaque type, even without
265
265
// the bounds that the function supplies.
266
- match infcx. register_hidden_type (
267
- OpaqueTypeKey { def_id, substs : id_substs } ,
268
- ObligationCause :: misc ( instantiated_ty. span , body_id) ,
269
- param_env,
270
- definition_ty,
271
- origin,
272
- ) {
266
+ let opaque_ty = self . tcx . mk_opaque ( def_id. to_def_id ( ) , id_substs) ;
267
+ match infcx
268
+ . at ( & ObligationCause :: misc ( instantiated_ty. span , body_id) , param_env)
269
+ . eq ( opaque_ty, definition_ty)
270
+ {
273
271
Ok ( infer_ok) => {
274
272
for obligation in infer_ok. obligations {
275
273
fulfillment_cx. register_predicate_obligation ( & infcx, obligation) ;
@@ -280,7 +278,7 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
280
278
. err_ctxt ( )
281
279
. report_mismatched_types (
282
280
& ObligationCause :: misc ( instantiated_ty. span , body_id) ,
283
- self . tcx . mk_opaque ( def_id . to_def_id ( ) , id_substs ) ,
281
+ opaque_ty ,
284
282
definition_ty,
285
283
err,
286
284
)
You can’t perform that action at this time.
0 commit comments