Skip to content

Commit aace4f7

Browse files
committed
remove canonicalize_query_preserving_universes
unused!
1 parent ead93d8 commit aace4f7

File tree

1 file changed

+0
-47
lines changed

1 file changed

+0
-47
lines changed

compiler/rustc_infer/src/infer/canonical/canonicalizer.rs

-47
Original file line numberDiff line numberDiff line change
@@ -44,29 +44,6 @@ impl<'tcx> InferCtxt<'tcx> {
4444
self.canonicalize_query_with_mode(value, query_state, &CanonicalizeAllFreeRegions)
4545
}
4646

47-
/// Like [Self::canonicalize_query], but preserves distinct universes. For
48-
/// example, canonicalizing `&'?0: Trait<'?1>`, where `'?0` is in `U1` and
49-
/// `'?1` is in `U3` would be canonicalized to have `?0` in `U1` and `'?1`
50-
/// in `U2`.
51-
///
52-
/// This is used for Chalk integration.
53-
pub fn canonicalize_query_preserving_universes<V>(
54-
&self,
55-
value: V,
56-
query_state: &mut OriginalQueryValues<'tcx>,
57-
) -> Canonical<'tcx, V>
58-
where
59-
V: TypeFoldable<TyCtxt<'tcx>>,
60-
{
61-
Canonicalizer::canonicalize(
62-
value,
63-
Some(self),
64-
self.tcx,
65-
&CanonicalizeAllFreeRegionsPreservingUniverses,
66-
query_state,
67-
)
68-
}
69-
7047
/// Canonicalizes a query *response* `V`. When we canonicalize a
7148
/// query response, we only canonicalize unbound inference
7249
/// variables, and we leave other free regions alone. So,
@@ -313,30 +290,6 @@ impl CanonicalizeMode for CanonicalizeAllFreeRegions {
313290
}
314291
}
315292

316-
struct CanonicalizeAllFreeRegionsPreservingUniverses;
317-
318-
impl CanonicalizeMode for CanonicalizeAllFreeRegionsPreservingUniverses {
319-
fn canonicalize_free_region<'tcx>(
320-
&self,
321-
canonicalizer: &mut Canonicalizer<'_, 'tcx>,
322-
r: ty::Region<'tcx>,
323-
) -> ty::Region<'tcx> {
324-
let universe = canonicalizer.infcx.unwrap().universe_of_region(r);
325-
canonicalizer.canonical_var_for_region(
326-
CanonicalVarInfo { kind: CanonicalVarKind::Region(universe) },
327-
r,
328-
)
329-
}
330-
331-
fn any(&self) -> bool {
332-
true
333-
}
334-
335-
fn preserve_universes(&self) -> bool {
336-
true
337-
}
338-
}
339-
340293
struct CanonicalizeFreeRegionsOtherThanStatic;
341294

342295
impl CanonicalizeMode for CanonicalizeFreeRegionsOtherThanStatic {

0 commit comments

Comments
 (0)