Skip to content

Commit 08e25e4

Browse files
committed
Adjust a comment to the new status quo
1 parent b2b5fa8 commit 08e25e4

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

compiler/rustc_infer/src/infer/canonical/query_response.rs

+3-6
Original file line numberDiff line numberDiff 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(

0 commit comments

Comments
 (0)