Skip to content

Commit

Permalink
remove canonicalize_query_preserving_universes
Browse files Browse the repository at this point in the history
unused!
  • Loading branch information
aliemjay committed Dec 14, 2023
1 parent 3b55869 commit e452c94
Showing 1 changed file with 0 additions and 47 deletions.
47 changes: 0 additions & 47 deletions compiler/rustc_infer/src/infer/canonical/canonicalizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<V>(
&self,
value: V,
query_state: &mut OriginalQueryValues<'tcx>,
) -> Canonical<'tcx, V>
where
V: TypeFoldable<TyCtxt<'tcx>>,
{
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,
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit e452c94

Please sign in to comment.