From 030c50824c670da9fecd3ccdaec4d75d3dab1268 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 7446f249688..bd5892dba38 100644 --- a/compiler/rustc_infer/src/infer/canonical/canonicalizer.rs +++ b/compiler/rustc_infer/src/infer/canonical/canonicalizer.rs @@ -53,7 +53,9 @@ pub fn canonicalize_query( /// 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 28b0ce9a171..93c2f202545 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 @@ fn select_where_possible( 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) => {