Skip to content

Commit 1d9159b

Browse files
Use InferTy from rustc_type_ir unconditionally
1 parent 069a4af commit 1d9159b

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

compiler/rustc_middle/src/ty/context.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ use crate::traits::solve::{
2626
};
2727
use crate::ty::{
2828
self, AdtDef, AdtDefData, AdtKind, Binder, Clause, Const, ConstData, GenericParamDefKind,
29-
ImplPolarity, InferTy, List, ParamConst, ParamTy, PolyExistentialPredicate, PolyFnSig,
30-
Predicate, PredicateKind, Region, RegionKind, ReprOptions, TraitObjectVisitor, Ty, TyKind,
31-
TyVid, TypeAndMut, Visibility,
29+
ImplPolarity, List, ParamConst, ParamTy, PolyExistentialPredicate, PolyFnSig, Predicate,
30+
PredicateKind, Region, RegionKind, ReprOptions, TraitObjectVisitor, Ty, TyKind, TyVid,
31+
TypeAndMut, Visibility,
3232
};
3333
use crate::ty::{GenericArg, GenericArgs, GenericArgsRef};
3434
use rustc_ast::{self as ast, attr};
@@ -95,7 +95,6 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
9595
type ParamTy = ParamTy;
9696
type BoundTy = ty::BoundTy;
9797
type PlaceholderTy = ty::PlaceholderType;
98-
type InferTy = InferTy;
9998

10099
type ErrorGuaranteed = ErrorGuaranteed;
101100
type BoundExistentialPredicates = &'tcx List<PolyExistentialPredicate<'tcx>>;

compiler/rustc_type_ir/src/debug.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
use crate::{Interner, UniverseIndex};
1+
use crate::{InferTy, Interner, UniverseIndex};
22

33
use core::fmt;
44
use std::marker::PhantomData;
55

66
pub trait InferCtxtLike {
77
type Interner: Interner;
88

9-
fn universe_of_ty(&self, ty: <Self::Interner as Interner>::InferTy) -> Option<UniverseIndex>;
9+
fn universe_of_ty(&self, ty: InferTy) -> Option<UniverseIndex>;
1010

1111
fn universe_of_lt(
1212
&self,
@@ -22,7 +22,7 @@ pub struct NoInfcx<I>(PhantomData<I>);
2222
impl<I: Interner> InferCtxtLike for NoInfcx<I> {
2323
type Interner = I;
2424

25-
fn universe_of_ty(&self, _ty: <I as Interner>::InferTy) -> Option<UniverseIndex> {
25+
fn universe_of_ty(&self, _ty: InferTy) -> Option<UniverseIndex> {
2626
None
2727
}
2828

compiler/rustc_type_ir/src/interner.rs

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ pub trait Interner: Sized {
2727
type ParamTy: Clone + Debug + Hash + Ord;
2828
type BoundTy: Clone + Debug + Hash + Ord;
2929
type PlaceholderTy: Clone + Debug + Hash + Ord;
30-
type InferTy: Clone + DebugWithInfcx<Self> + Hash + Ord;
3130

3231
// Things stored inside of tys
3332
type ErrorGuaranteed: Clone + Debug + Hash + Ord;

compiler/rustc_type_ir/src/ty_kind.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ pub enum TyKind<I: Interner> {
281281
/// correctly deal with higher ranked types. Though unlike placeholders,
282282
/// that universe is stored in the `InferCtxt` instead of directly
283283
/// inside of the type.
284-
Infer(I::InferTy),
284+
Infer(InferTy),
285285

286286
/// A placeholder for a type which could not be computed; this is
287287
/// propagated to avoid useless error messages.
@@ -488,7 +488,6 @@ where
488488
I::BoundTy: HashStable<CTX>,
489489
I::ParamTy: HashStable<CTX>,
490490
I::PlaceholderTy: HashStable<CTX>,
491-
I::InferTy: HashStable<CTX>,
492491
I::ErrorGuaranteed: HashStable<CTX>,
493492
{
494493
#[inline]
@@ -909,7 +908,7 @@ impl fmt::Debug for InferTy {
909908
}
910909
}
911910

912-
impl<I: Interner<InferTy = InferTy>> DebugWithInfcx<I> for InferTy {
911+
impl<I: Interner> DebugWithInfcx<I> for InferTy {
913912
fn fmt<Infcx: InferCtxtLike<Interner = I>>(
914913
this: WithInfcx<'_, Infcx, &Self>,
915914
f: &mut fmt::Formatter<'_>,

0 commit comments

Comments
 (0)