Uplift Goal to rustc_type_ir
This commit is contained in:
@@ -78,9 +78,9 @@ impl<T: Hash> Hash for Obligation<'_, T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx, P> From<Obligation<'tcx, P>> for solve::Goal<'tcx, P> {
|
||||
impl<'tcx, P> From<Obligation<'tcx, P>> for ty::Goal<'tcx, P> {
|
||||
fn from(value: Obligation<'tcx, P>) -> Self {
|
||||
solve::Goal { param_env: value.param_env, predicate: value.predicate }
|
||||
ty::Goal { param_env: value.param_env, predicate: value.predicate }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ impl<'tcx, O> Obligation<'tcx, O> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
cause: ObligationCause<'tcx>,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
predicate: impl Upcast<'tcx, O>,
|
||||
predicate: impl Upcast<TyCtxt<'tcx>, O>,
|
||||
) -> Obligation<'tcx, O> {
|
||||
Self::with_depth(tcx, cause, 0, param_env, predicate)
|
||||
}
|
||||
@@ -173,7 +173,7 @@ impl<'tcx, O> Obligation<'tcx, O> {
|
||||
cause: ObligationCause<'tcx>,
|
||||
recursion_depth: usize,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
predicate: impl Upcast<'tcx, O>,
|
||||
predicate: impl Upcast<TyCtxt<'tcx>, O>,
|
||||
) -> Obligation<'tcx, O> {
|
||||
let predicate = predicate.upcast(tcx);
|
||||
Obligation { cause, param_env, recursion_depth, predicate }
|
||||
@@ -184,12 +184,16 @@ impl<'tcx, O> Obligation<'tcx, O> {
|
||||
span: Span,
|
||||
body_id: LocalDefId,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
trait_ref: impl Upcast<'tcx, O>,
|
||||
trait_ref: impl Upcast<TyCtxt<'tcx>, O>,
|
||||
) -> Obligation<'tcx, O> {
|
||||
Obligation::new(tcx, ObligationCause::misc(span, body_id), param_env, trait_ref)
|
||||
}
|
||||
|
||||
pub fn with<P>(&self, tcx: TyCtxt<'tcx>, value: impl Upcast<'tcx, P>) -> Obligation<'tcx, P> {
|
||||
pub fn with<P>(
|
||||
&self,
|
||||
tcx: TyCtxt<'tcx>,
|
||||
value: impl Upcast<TyCtxt<'tcx>, P>,
|
||||
) -> Obligation<'tcx, P> {
|
||||
Obligation::with_depth(tcx, self.cause.clone(), self.recursion_depth, self.param_env, value)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user