diff options
| author | Michael Goulet <michael@errs.io> | 2023-11-12 19:44:48 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-11-20 17:27:41 +0000 |
| commit | c3ba158d3017258cc47486f49a95a2835d35154d (patch) | |
| tree | 673d0a32550d8eabb17dd44efa3a21867a3264e9 | |
| parent | 46ecc10c6951a2a0e52d93fe5d3acae9743e3ab9 (diff) | |
| download | rust-c3ba158d3017258cc47486f49a95a2835d35154d.tar.gz rust-c3ba158d3017258cc47486f49a95a2835d35154d.zip | |
Use InferTy from rustc_type_ir unconditionally
| -rw-r--r-- | compiler/rustc_middle/src/ty/context.rs | 7 | ||||
| -rw-r--r-- | compiler/rustc_type_ir/src/debug.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_type_ir/src/interner.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_type_ir/src/ty_kind.rs | 5 |
4 files changed, 8 insertions, 11 deletions
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index ee23c9c4897..b2a379064d6 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -26,9 +26,9 @@ use crate::traits::solve::{ }; use crate::ty::{ self, AdtDef, AdtDefData, AdtKind, Binder, Clause, Const, ConstData, GenericParamDefKind, - ImplPolarity, InferTy, List, ParamConst, ParamTy, PolyExistentialPredicate, PolyFnSig, - Predicate, PredicateKind, Region, RegionKind, ReprOptions, TraitObjectVisitor, Ty, TyKind, - TyVid, TypeAndMut, Visibility, + ImplPolarity, List, ParamConst, ParamTy, PolyExistentialPredicate, PolyFnSig, Predicate, + PredicateKind, Region, RegionKind, ReprOptions, TraitObjectVisitor, Ty, TyKind, TyVid, + TypeAndMut, Visibility, }; use crate::ty::{GenericArg, GenericArgs, GenericArgsRef}; use rustc_ast::{self as ast, attr}; @@ -95,7 +95,6 @@ impl<'tcx> Interner for TyCtxt<'tcx> { type ParamTy = ParamTy; type BoundTy = ty::BoundTy; type PlaceholderTy = ty::PlaceholderType; - type InferTy = InferTy; type ErrorGuaranteed = ErrorGuaranteed; type BoundExistentialPredicates = &'tcx List<PolyExistentialPredicate<'tcx>>; diff --git a/compiler/rustc_type_ir/src/debug.rs b/compiler/rustc_type_ir/src/debug.rs index 4ea3eb3e84f..a76374efc72 100644 --- a/compiler/rustc_type_ir/src/debug.rs +++ b/compiler/rustc_type_ir/src/debug.rs @@ -1,4 +1,4 @@ -use crate::{Interner, UniverseIndex}; +use crate::{InferTy, Interner, UniverseIndex}; use core::fmt; use std::marker::PhantomData; @@ -6,7 +6,7 @@ use std::marker::PhantomData; pub trait InferCtxtLike { type Interner: Interner; - fn universe_of_ty(&self, ty: <Self::Interner as Interner>::InferTy) -> Option<UniverseIndex>; + fn universe_of_ty(&self, ty: InferTy) -> Option<UniverseIndex>; fn universe_of_lt( &self, @@ -22,7 +22,7 @@ pub struct NoInfcx<I>(PhantomData<I>); impl<I: Interner> InferCtxtLike for NoInfcx<I> { type Interner = I; - fn universe_of_ty(&self, _ty: <I as Interner>::InferTy) -> Option<UniverseIndex> { + fn universe_of_ty(&self, _ty: InferTy) -> Option<UniverseIndex> { None } diff --git a/compiler/rustc_type_ir/src/interner.rs b/compiler/rustc_type_ir/src/interner.rs index da504c54fdd..3a00115aade 100644 --- a/compiler/rustc_type_ir/src/interner.rs +++ b/compiler/rustc_type_ir/src/interner.rs @@ -27,7 +27,6 @@ pub trait Interner: Sized { type ParamTy: Clone + Debug + Hash + Ord; type BoundTy: Clone + Debug + Hash + Ord; type PlaceholderTy: Clone + Debug + Hash + Ord; - type InferTy: Clone + DebugWithInfcx<Self> + Hash + Ord; // Things stored inside of tys type ErrorGuaranteed: Clone + Debug + Hash + Ord; diff --git a/compiler/rustc_type_ir/src/ty_kind.rs b/compiler/rustc_type_ir/src/ty_kind.rs index f31c5069b15..53446c41f31 100644 --- a/compiler/rustc_type_ir/src/ty_kind.rs +++ b/compiler/rustc_type_ir/src/ty_kind.rs @@ -281,7 +281,7 @@ pub enum TyKind<I: Interner> { /// correctly deal with higher ranked types. Though unlike placeholders, /// that universe is stored in the `InferCtxt` instead of directly /// inside of the type. - Infer(I::InferTy), + Infer(InferTy), /// A placeholder for a type which could not be computed; this is /// propagated to avoid useless error messages. @@ -491,7 +491,6 @@ where I::BoundTy: HashStable<CTX>, I::ParamTy: HashStable<CTX>, I::PlaceholderTy: HashStable<CTX>, - I::InferTy: HashStable<CTX>, I::ErrorGuaranteed: HashStable<CTX>, { #[inline] @@ -922,7 +921,7 @@ impl fmt::Debug for InferTy { } } -impl<I: Interner<InferTy = InferTy>> DebugWithInfcx<I> for InferTy { +impl<I: Interner> DebugWithInfcx<I> for InferTy { fn fmt<Infcx: InferCtxtLike<Interner = I>>( this: WithInfcx<'_, Infcx, &Self>, f: &mut fmt::Formatter<'_>, |
