optimize CanonicalVarValues::instantiate

This commit is contained in:
lcnr
2025-08-27 09:42:09 +02:00
parent 28a0e77d13
commit f514586408
9 changed files with 63 additions and 56 deletions

View File

@@ -184,10 +184,9 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
R: Debug + TypeFoldable<TyCtxt<'tcx>>,
Canonical<'tcx, QueryResponse<'tcx, R>>: ArenaAllocatable<'tcx>,
{
let (infcx, key, canonical_inference_vars) =
self.build_with_canonical(DUMMY_SP, canonical_key);
let (infcx, key, var_values) = self.build_with_canonical(DUMMY_SP, canonical_key);
let ocx = ObligationCtxt::new(&infcx);
let value = operation(&ocx, key)?;
ocx.make_canonicalized_query_response(canonical_inference_vars, value)
ocx.make_canonicalized_query_response(var_values, value)
}
}