Rename ToPredicate for Upcast
This commit is contained in:
@@ -13,7 +13,7 @@ use rustc_middle::traits::BuiltinImplSource;
|
||||
use rustc_middle::ty::fast_reject::{SimplifiedType, TreatParams};
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt};
|
||||
use rustc_middle::ty::{fast_reject, TypeFoldable};
|
||||
use rustc_middle::ty::{ToPredicate, TypeVisitableExt};
|
||||
use rustc_middle::ty::{TypeVisitableExt, Upcast};
|
||||
use rustc_span::{ErrorGuaranteed, DUMMY_SP};
|
||||
use std::fmt::Debug;
|
||||
|
||||
@@ -744,7 +744,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
|
||||
ecx,
|
||||
CandidateSource::BuiltinImpl(BuiltinImplSource::Object { vtable_base }),
|
||||
goal,
|
||||
assumption.to_predicate(tcx),
|
||||
assumption.upcast(tcx),
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -7,9 +7,7 @@ use rustc_infer::traits::query::NoSolution;
|
||||
use rustc_macros::{TypeFoldable, TypeVisitable};
|
||||
use rustc_middle::bug;
|
||||
use rustc_middle::traits::solve::Goal;
|
||||
use rustc_middle::ty::{
|
||||
self, ToPredicate, Ty, TyCtxt, TypeFoldable, TypeFolder, TypeSuperFoldable,
|
||||
};
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable, TypeFolder, TypeSuperFoldable, Upcast};
|
||||
use rustc_span::sym;
|
||||
|
||||
use crate::solve::EvalCtxt;
|
||||
@@ -429,7 +427,7 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_async_callable<'tc
|
||||
tcx.require_lang_item(LangItem::AsyncFnKindHelper, None),
|
||||
[kind_ty, Ty::from_closure_kind(tcx, goal_kind)],
|
||||
)
|
||||
.to_predicate(tcx),
|
||||
.upcast(tcx),
|
||||
);
|
||||
|
||||
coroutine_closure_to_ambiguous_coroutine(
|
||||
@@ -456,7 +454,7 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_async_callable<'tc
|
||||
let nested = vec![
|
||||
bound_sig
|
||||
.rebind(ty::TraitRef::new(tcx, future_trait_def_id, [sig.output()]))
|
||||
.to_predicate(tcx),
|
||||
.upcast(tcx),
|
||||
];
|
||||
let future_output_def_id = tcx
|
||||
.associated_items(future_trait_def_id)
|
||||
@@ -484,7 +482,7 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_async_callable<'tc
|
||||
let mut nested = vec![
|
||||
bound_sig
|
||||
.rebind(ty::TraitRef::new(tcx, future_trait_def_id, [sig.output()]))
|
||||
.to_predicate(tcx),
|
||||
.upcast(tcx),
|
||||
];
|
||||
|
||||
// Additionally, we need to check that the closure kind
|
||||
@@ -510,7 +508,7 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_async_callable<'tc
|
||||
async_fn_kind_trait_def_id,
|
||||
[kind_ty, Ty::from_closure_kind(tcx, goal_kind)],
|
||||
)
|
||||
.to_predicate(tcx),
|
||||
.upcast(tcx),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ use rustc_middle::traits::BuiltinImplSource;
|
||||
use rustc_middle::ty::fast_reject::{DeepRejectCtxt, TreatParams};
|
||||
use rustc_middle::ty::NormalizesTo;
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt};
|
||||
use rustc_middle::ty::{ToPredicate, TypeVisitableExt};
|
||||
use rustc_middle::ty::{TypeVisitableExt, Upcast};
|
||||
use rustc_middle::{bug, span_bug};
|
||||
use rustc_span::{sym, ErrorGuaranteed, DUMMY_SP};
|
||||
|
||||
@@ -370,7 +370,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
|
||||
),
|
||||
term: output.into(),
|
||||
})
|
||||
.to_predicate(tcx);
|
||||
.upcast(tcx);
|
||||
|
||||
// A built-in `Fn` impl only holds if the output is sized.
|
||||
// (FIXME: technically we only need to check this if the type is a fn ptr...)
|
||||
@@ -452,7 +452,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
|
||||
ty::ProjectionPredicate { projection_term, term }
|
||||
},
|
||||
)
|
||||
.to_predicate(tcx);
|
||||
.upcast(tcx);
|
||||
|
||||
// A built-in `AsyncFn` impl only holds if the output is sized.
|
||||
// (FIXME: technically we only need to check this if the type is a fn ptr...)
|
||||
@@ -629,7 +629,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
|
||||
projection_term: ty::AliasTerm::new(ecx.tcx(), goal.predicate.def_id(), [self_ty]),
|
||||
term,
|
||||
}
|
||||
.to_predicate(tcx),
|
||||
.upcast(tcx),
|
||||
// Technically, we need to check that the future type is Sized,
|
||||
// but that's already proven by the coroutine being WF.
|
||||
[],
|
||||
@@ -661,7 +661,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
|
||||
projection_term: ty::AliasTerm::new(ecx.tcx(), goal.predicate.def_id(), [self_ty]),
|
||||
term,
|
||||
}
|
||||
.to_predicate(tcx),
|
||||
.upcast(tcx),
|
||||
// Technically, we need to check that the iterator type is Sized,
|
||||
// but that's already proven by the generator being WF.
|
||||
[],
|
||||
@@ -749,7 +749,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
|
||||
),
|
||||
term,
|
||||
}
|
||||
.to_predicate(tcx),
|
||||
.upcast(tcx),
|
||||
// Technically, we need to check that the coroutine type is Sized,
|
||||
// but that's already proven by the coroutine being WF.
|
||||
[],
|
||||
|
||||
@@ -15,7 +15,7 @@ use rustc_middle::traits::solve::inspect::ProbeKind;
|
||||
use rustc_middle::traits::solve::{CandidateSource, Certainty, Goal, QueryResult};
|
||||
use rustc_middle::traits::{BuiltinImplSource, Reveal};
|
||||
use rustc_middle::ty::fast_reject::{DeepRejectCtxt, TreatParams};
|
||||
use rustc_middle::ty::{self, ToPredicate, Ty, TyCtxt};
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt, Upcast};
|
||||
use rustc_middle::ty::{TraitPredicate, TypeVisitableExt};
|
||||
use rustc_span::ErrorGuaranteed;
|
||||
|
||||
@@ -315,7 +315,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
|
||||
.map_bound(|(inputs, _)| {
|
||||
ty::TraitRef::new(tcx, goal.predicate.def_id(), [goal.predicate.self_ty(), inputs])
|
||||
})
|
||||
.to_predicate(tcx);
|
||||
.upcast(tcx);
|
||||
// A built-in `Fn` impl only holds if the output is sized.
|
||||
// (FIXME: technically we only need to check this if the type is a fn ptr...)
|
||||
Self::probe_and_consider_implied_clause(
|
||||
@@ -363,7 +363,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
|
||||
[goal.predicate.self_ty(), tupled_inputs_ty],
|
||||
)
|
||||
})
|
||||
.to_predicate(tcx);
|
||||
.upcast(tcx);
|
||||
// A built-in `AsyncFn` impl only holds if the output is sized.
|
||||
// (FIXME: technically we only need to check this if the type is a fn ptr...)
|
||||
Self::probe_and_consider_implied_clause(
|
||||
@@ -560,7 +560,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
|
||||
CandidateSource::BuiltinImpl(BuiltinImplSource::Misc),
|
||||
goal,
|
||||
ty::TraitRef::new(tcx, goal.predicate.def_id(), [self_ty, coroutine.resume_ty()])
|
||||
.to_predicate(tcx),
|
||||
.upcast(tcx),
|
||||
// Technically, we need to check that the coroutine types are Sized,
|
||||
// but that's already proven by the coroutine being WF.
|
||||
[],
|
||||
|
||||
Reference in New Issue
Block a user