File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
compiler/rustc_borrowck/src/region_infer Expand file tree Collapse file tree 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> {
263263
264264 // Require that the hidden type actually fulfills all the bounds of the opaque type, even without
265265 // 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+ {
273271 Ok ( infer_ok) => {
274272 for obligation in infer_ok. obligations {
275273 fulfillment_cx. register_predicate_obligation ( & infcx, obligation) ;
@@ -280,7 +278,7 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
280278 . err_ctxt ( )
281279 . report_mismatched_types (
282280 & ObligationCause :: misc ( instantiated_ty. span , body_id) ,
283- self . tcx . mk_opaque ( def_id . to_def_id ( ) , id_substs ) ,
281+ opaque_ty ,
284282 definition_ty,
285283 err,
286284 )
You can’t perform that action at this time.
0 commit comments