From cff59f80e4ad2325dc3550da762c37721e2bad37 Mon Sep 17 00:00:00 2001 From: lcnr Date: Wed, 22 Feb 2023 13:28:01 +0100 Subject: [PATCH] apply query response: actually define opaque types --- .../rustc_infer/src/infer/canonical/query_response.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_infer/src/infer/canonical/query_response.rs b/compiler/rustc_infer/src/infer/canonical/query_response.rs index e993fb4c22b..7177e2f1017 100644 --- a/compiler/rustc_infer/src/infer/canonical/query_response.rs +++ b/compiler/rustc_infer/src/infer/canonical/query_response.rs @@ -393,6 +393,7 @@ fn query_response_substitution( /// will instantiate fresh inference variables for each canonical /// variable instead. Therefore, the result of this method must be /// properly unified + #[instrument(level = "debug", skip(self, cause, param_env))] fn query_response_substitution_guess( &self, cause: &ObligationCause<'tcx>, @@ -403,11 +404,6 @@ fn query_response_substitution_guess( where R: Debug + TypeFoldable<'tcx>, { - debug!( - "query_response_substitution_guess(original_values={:#?}, query_response={:#?})", - original_values, query_response, - ); - // For each new universe created in the query result that did // not appear in the original query, create a local // superuniverse. @@ -502,7 +498,9 @@ fn query_response_substitution_guess( for &(a, b) in &query_response.value.opaque_types { let a = substitute_value(self.tcx, &result_subst, a); let b = substitute_value(self.tcx, &result_subst, b); - obligations.extend(self.at(cause, param_env).eq(a, b)?.obligations); + debug!(?a, ?b, "constrain opaque type"); + obligations + .extend(self.at(cause, param_env).define_opaque_types(true).eq(a, b)?.obligations); } Ok(InferOk { value: result_subst, obligations })