Remove type-traversal trait aliases
This commit is contained in:
parent
3b4d6e0804
commit
695072daa6
191 changed files with 657 additions and 569 deletions
|
@ -26,10 +26,10 @@ use rustc_middle::mir::ConstraintCategory;
|
|||
use rustc_middle::traits::select;
|
||||
use rustc_middle::ty::error::{ExpectedFound, TypeError};
|
||||
use rustc_middle::ty::fold::BoundVarReplacerDelegate;
|
||||
use rustc_middle::ty::fold::{ir::TypeFolder, TypeFoldable, TypeSuperFoldable};
|
||||
use rustc_middle::ty::fold::{TypeFoldable, TypeFolder, TypeSuperFoldable};
|
||||
use rustc_middle::ty::relate::RelateResult;
|
||||
use rustc_middle::ty::subst::{GenericArg, GenericArgKind, InternalSubsts, SubstsRef};
|
||||
use rustc_middle::ty::visit::TypeVisitable;
|
||||
use rustc_middle::ty::visit::{TypeVisitable, TypeVisitableExt};
|
||||
pub use rustc_middle::ty::IntVarValue;
|
||||
use rustc_middle::ty::{self, GenericParamDefKind, InferConst, InferTy, Ty, TyCtxt};
|
||||
use rustc_middle::ty::{ConstVid, FloatVid, IntVid, TyVid};
|
||||
|
@ -617,7 +617,7 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
|
|||
canonical: &Canonical<'tcx, T>,
|
||||
) -> (InferCtxt<'tcx>, T, CanonicalVarValues<'tcx>)
|
||||
where
|
||||
T: TypeFoldable<'tcx>,
|
||||
T: TypeFoldable<TyCtxt<'tcx>>,
|
||||
{
|
||||
let infcx = self.build();
|
||||
let (value, subst) = infcx.instantiate_canonical_with_fresh_inference_vars(span, canonical);
|
||||
|
@ -697,7 +697,7 @@ impl<'tcx> InferCtxt<'tcx> {
|
|||
self.in_snapshot.get()
|
||||
}
|
||||
|
||||
pub fn freshen<T: TypeFoldable<'tcx>>(&self, t: T) -> T {
|
||||
pub fn freshen<T: TypeFoldable<TyCtxt<'tcx>>>(&self, t: T) -> T {
|
||||
t.fold_with(&mut self.freshener())
|
||||
}
|
||||
|
||||
|
@ -1371,7 +1371,7 @@ impl<'tcx> InferCtxt<'tcx> {
|
|||
/// will be resolving them as well, e.g. in a loop).
|
||||
pub fn shallow_resolve<T>(&self, value: T) -> T
|
||||
where
|
||||
T: TypeFoldable<'tcx>,
|
||||
T: TypeFoldable<TyCtxt<'tcx>>,
|
||||
{
|
||||
value.fold_with(&mut ShallowResolver { infcx: self })
|
||||
}
|
||||
|
@ -1388,7 +1388,7 @@ impl<'tcx> InferCtxt<'tcx> {
|
|||
/// at will.
|
||||
pub fn resolve_vars_if_possible<T>(&self, value: T) -> T
|
||||
where
|
||||
T: TypeFoldable<'tcx>,
|
||||
T: TypeFoldable<TyCtxt<'tcx>>,
|
||||
{
|
||||
if !value.has_non_region_infer() {
|
||||
return value;
|
||||
|
@ -1399,7 +1399,7 @@ impl<'tcx> InferCtxt<'tcx> {
|
|||
|
||||
pub fn resolve_numeric_literals_with_default<T>(&self, value: T) -> T
|
||||
where
|
||||
T: TypeFoldable<'tcx>,
|
||||
T: TypeFoldable<TyCtxt<'tcx>>,
|
||||
{
|
||||
if !value.needs_infer() {
|
||||
return value; // Avoid duplicated subst-folding.
|
||||
|
@ -1414,7 +1414,7 @@ impl<'tcx> InferCtxt<'tcx> {
|
|||
value: &T,
|
||||
) -> Option<(ty::Term<'tcx>, Option<Span>)>
|
||||
where
|
||||
T: TypeVisitable<'tcx>,
|
||||
T: TypeVisitable<TyCtxt<'tcx>>,
|
||||
{
|
||||
value.visit_with(&mut resolve::UnresolvedTypeOrConstFinder::new(self)).break_value()
|
||||
}
|
||||
|
@ -1429,7 +1429,7 @@ impl<'tcx> InferCtxt<'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn fully_resolve<T: TypeFoldable<'tcx>>(&self, value: T) -> FixupResult<'tcx, T> {
|
||||
pub fn fully_resolve<T: TypeFoldable<TyCtxt<'tcx>>>(&self, value: T) -> FixupResult<'tcx, T> {
|
||||
/*!
|
||||
* Attempts to resolve all type/region/const variables in
|
||||
* `value`. Region inference must have been run already (e.g.,
|
||||
|
@ -1462,7 +1462,7 @@ impl<'tcx> InferCtxt<'tcx> {
|
|||
value: ty::Binder<'tcx, T>,
|
||||
) -> T
|
||||
where
|
||||
T: TypeFoldable<'tcx> + Copy,
|
||||
T: TypeFoldable<TyCtxt<'tcx>> + Copy,
|
||||
{
|
||||
if let Some(inner) = value.no_bound_vars() {
|
||||
return inner;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue