Use InferTy from rustc_type_ir unconditionally
This commit is contained in:
parent
46ecc10c69
commit
c3ba158d30
4 changed files with 8 additions and 11 deletions
|
@ -26,9 +26,9 @@ use crate::traits::solve::{
|
||||||
};
|
};
|
||||||
use crate::ty::{
|
use crate::ty::{
|
||||||
self, AdtDef, AdtDefData, AdtKind, Binder, Clause, Const, ConstData, GenericParamDefKind,
|
self, AdtDef, AdtDefData, AdtKind, Binder, Clause, Const, ConstData, GenericParamDefKind,
|
||||||
ImplPolarity, InferTy, List, ParamConst, ParamTy, PolyExistentialPredicate, PolyFnSig,
|
ImplPolarity, List, ParamConst, ParamTy, PolyExistentialPredicate, PolyFnSig, Predicate,
|
||||||
Predicate, PredicateKind, Region, RegionKind, ReprOptions, TraitObjectVisitor, Ty, TyKind,
|
PredicateKind, Region, RegionKind, ReprOptions, TraitObjectVisitor, Ty, TyKind, TyVid,
|
||||||
TyVid, TypeAndMut, Visibility,
|
TypeAndMut, Visibility,
|
||||||
};
|
};
|
||||||
use crate::ty::{GenericArg, GenericArgs, GenericArgsRef};
|
use crate::ty::{GenericArg, GenericArgs, GenericArgsRef};
|
||||||
use rustc_ast::{self as ast, attr};
|
use rustc_ast::{self as ast, attr};
|
||||||
|
@ -95,7 +95,6 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
|
||||||
type ParamTy = ParamTy;
|
type ParamTy = ParamTy;
|
||||||
type BoundTy = ty::BoundTy;
|
type BoundTy = ty::BoundTy;
|
||||||
type PlaceholderTy = ty::PlaceholderType;
|
type PlaceholderTy = ty::PlaceholderType;
|
||||||
type InferTy = InferTy;
|
|
||||||
|
|
||||||
type ErrorGuaranteed = ErrorGuaranteed;
|
type ErrorGuaranteed = ErrorGuaranteed;
|
||||||
type BoundExistentialPredicates = &'tcx List<PolyExistentialPredicate<'tcx>>;
|
type BoundExistentialPredicates = &'tcx List<PolyExistentialPredicate<'tcx>>;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::{Interner, UniverseIndex};
|
use crate::{InferTy, Interner, UniverseIndex};
|
||||||
|
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
@ -6,7 +6,7 @@ use std::marker::PhantomData;
|
||||||
pub trait InferCtxtLike {
|
pub trait InferCtxtLike {
|
||||||
type Interner: Interner;
|
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(
|
fn universe_of_lt(
|
||||||
&self,
|
&self,
|
||||||
|
@ -22,7 +22,7 @@ pub struct NoInfcx<I>(PhantomData<I>);
|
||||||
impl<I: Interner> InferCtxtLike for NoInfcx<I> {
|
impl<I: Interner> InferCtxtLike for NoInfcx<I> {
|
||||||
type Interner = 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
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,6 @@ pub trait Interner: Sized {
|
||||||
type ParamTy: Clone + Debug + Hash + Ord;
|
type ParamTy: Clone + Debug + Hash + Ord;
|
||||||
type BoundTy: Clone + Debug + Hash + Ord;
|
type BoundTy: Clone + Debug + Hash + Ord;
|
||||||
type PlaceholderTy: Clone + Debug + Hash + Ord;
|
type PlaceholderTy: Clone + Debug + Hash + Ord;
|
||||||
type InferTy: Clone + DebugWithInfcx<Self> + Hash + Ord;
|
|
||||||
|
|
||||||
// Things stored inside of tys
|
// Things stored inside of tys
|
||||||
type ErrorGuaranteed: Clone + Debug + Hash + Ord;
|
type ErrorGuaranteed: Clone + Debug + Hash + Ord;
|
||||||
|
|
|
@ -281,7 +281,7 @@ pub enum TyKind<I: Interner> {
|
||||||
/// correctly deal with higher ranked types. Though unlike placeholders,
|
/// correctly deal with higher ranked types. Though unlike placeholders,
|
||||||
/// that universe is stored in the `InferCtxt` instead of directly
|
/// that universe is stored in the `InferCtxt` instead of directly
|
||||||
/// inside of the type.
|
/// inside of the type.
|
||||||
Infer(I::InferTy),
|
Infer(InferTy),
|
||||||
|
|
||||||
/// A placeholder for a type which could not be computed; this is
|
/// A placeholder for a type which could not be computed; this is
|
||||||
/// propagated to avoid useless error messages.
|
/// propagated to avoid useless error messages.
|
||||||
|
@ -491,7 +491,6 @@ where
|
||||||
I::BoundTy: HashStable<CTX>,
|
I::BoundTy: HashStable<CTX>,
|
||||||
I::ParamTy: HashStable<CTX>,
|
I::ParamTy: HashStable<CTX>,
|
||||||
I::PlaceholderTy: HashStable<CTX>,
|
I::PlaceholderTy: HashStable<CTX>,
|
||||||
I::InferTy: HashStable<CTX>,
|
|
||||||
I::ErrorGuaranteed: HashStable<CTX>,
|
I::ErrorGuaranteed: HashStable<CTX>,
|
||||||
{
|
{
|
||||||
#[inline]
|
#[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>>(
|
fn fmt<Infcx: InferCtxtLike<Interner = I>>(
|
||||||
this: WithInfcx<'_, Infcx, &Self>,
|
this: WithInfcx<'_, Infcx, &Self>,
|
||||||
f: &mut fmt::Formatter<'_>,
|
f: &mut fmt::Formatter<'_>,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue