From 575f1734be57d33013041c84eaf5dc7783d6e85a Mon Sep 17 00:00:00 2001 From: Matthew Jasper Date: Fri, 11 Feb 2022 18:20:47 +0000 Subject: [PATCH] Address review comment canonicalize_chalk_query -> canonicalize_query_preserving_universes --- compiler/rustc_infer/src/infer/canonical/canonicalizer.rs | 4 +++- compiler/rustc_trait_selection/src/traits/chalk_fulfill.rs | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_infer/src/infer/canonical/canonicalizer.rs b/compiler/rustc_infer/src/infer/canonical/canonicalizer.rs index 7446f24968803..bd5892dba38c7 100644 --- a/compiler/rustc_infer/src/infer/canonical/canonicalizer.rs +++ b/compiler/rustc_infer/src/infer/canonical/canonicalizer.rs @@ -53,7 +53,9 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> { /// example, canonicalizing `&'?0: Trait<'?1>`, where `'?0` is in `U1` and /// `'?1` is in `U3` would be canonicalized to have ?0` in `U1` and `'?1` /// in `U2`. - pub fn canonicalize_chalk_query( + /// + /// This is used for Chalk integration. + pub fn canonicalize_query_preserving_universes( &self, value: V, query_state: &mut OriginalQueryValues<'tcx>, diff --git a/compiler/rustc_trait_selection/src/traits/chalk_fulfill.rs b/compiler/rustc_trait_selection/src/traits/chalk_fulfill.rs index 28b0ce9a171f8..93c2f202545f6 100644 --- a/compiler/rustc_trait_selection/src/traits/chalk_fulfill.rs +++ b/compiler/rustc_trait_selection/src/traits/chalk_fulfill.rs @@ -95,7 +95,8 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentContext<'tcx> { continue; } - let canonical_goal = infcx.canonicalize_chalk_query(goal, &mut orig_values); + let canonical_goal = + infcx.canonicalize_query_preserving_universes(goal, &mut orig_values); match infcx.tcx.evaluate_goal(canonical_goal) { Ok(response) => {