File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
compiler/rustc_infer/src/infer/canonical Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -505,12 +505,9 @@ impl<'tcx> InferCtxt<'tcx> {
505505 let b = instantiate_value ( self . tcx , & result_args, b) ;
506506 debug ! ( ?a, ?b, "constrain opaque type" ) ;
507507 // We use equate here instead of, for example, just registering the
508- // opaque type's hidden value directly, because we may be instantiating
509- // a query response that was canonicalized in an InferCtxt that had
510- // a different defining anchor. In that case, we may have inferred
511- // `NonLocalOpaque := LocalOpaque` but can only instantiate it in
512- // the other direction as `LocalOpaque := NonLocalOpaque`. Using eq
513- // here allows us to try both directions (in `InferCtxt::handle_opaque_type`).
508+ // opaque type's hidden value directly, because the hidden type may have been an inference
509+ // variable that got constrained to the opaque type itself. In that case we want to equate
510+ // the generic args of the opaque with the generic params of its hidden type version.
514511 obligations. extend (
515512 self . at ( cause, param_env)
516513 . eq (
You can’t perform that action at this time.
0 commit comments