From e452c949128f636bfa201af6445f9247a99db13e Mon Sep 17 00:00:00 2001 From: Ali MJ Al-Nasrawy Date: Wed, 6 Dec 2023 16:56:59 +0000 Subject: [PATCH] remove canonicalize_query_preserving_universes unused! --- .../src/infer/canonical/canonicalizer.rs | 47 ------------------- 1 file changed, 47 deletions(-) diff --git a/compiler/rustc_infer/src/infer/canonical/canonicalizer.rs b/compiler/rustc_infer/src/infer/canonical/canonicalizer.rs index ebb726e4d3236..5b00ef42211e8 100644 --- a/compiler/rustc_infer/src/infer/canonical/canonicalizer.rs +++ b/compiler/rustc_infer/src/infer/canonical/canonicalizer.rs @@ -44,29 +44,6 @@ impl<'tcx> InferCtxt<'tcx> { self.canonicalize_query_with_mode(value, query_state, &CanonicalizeAllFreeRegions) } - /// Like [Self::canonicalize_query], but preserves distinct universes. For - /// 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`. - /// - /// This is used for Chalk integration. - pub fn canonicalize_query_preserving_universes( - &self, - value: V, - query_state: &mut OriginalQueryValues<'tcx>, - ) -> Canonical<'tcx, V> - where - V: TypeFoldable>, - { - Canonicalizer::canonicalize( - value, - Some(self), - self.tcx, - &CanonicalizeAllFreeRegionsPreservingUniverses, - query_state, - ) - } - /// Canonicalizes a query *response* `V`. When we canonicalize a /// query response, we only canonicalize unbound inference /// variables, and we leave other free regions alone. So, @@ -313,30 +290,6 @@ impl CanonicalizeMode for CanonicalizeAllFreeRegions { } } -struct CanonicalizeAllFreeRegionsPreservingUniverses; - -impl CanonicalizeMode for CanonicalizeAllFreeRegionsPreservingUniverses { - fn canonicalize_free_region<'tcx>( - &self, - canonicalizer: &mut Canonicalizer<'_, 'tcx>, - r: ty::Region<'tcx>, - ) -> ty::Region<'tcx> { - let universe = canonicalizer.infcx.unwrap().universe_of_region(r); - canonicalizer.canonical_var_for_region( - CanonicalVarInfo { kind: CanonicalVarKind::Region(universe) }, - r, - ) - } - - fn any(&self) -> bool { - true - } - - fn preserve_universes(&self) -> bool { - true - } -} - struct CanonicalizeFreeRegionsOtherThanStatic; impl CanonicalizeMode for CanonicalizeFreeRegionsOtherThanStatic {