Add back in normalize call
This commit is contained in:
parent
e09242d5b8
commit
1eb71f0893
@ -76,15 +76,18 @@ struct AscribeUserTypeCx<'me, 'tcx> {
|
|||||||
|
|
||||||
impl<'me, 'tcx> AscribeUserTypeCx<'me, 'tcx> {
|
impl<'me, 'tcx> AscribeUserTypeCx<'me, 'tcx> {
|
||||||
fn normalize<T>(&mut self, value: T) -> T
|
fn normalize<T>(&mut self, value: T) -> T
|
||||||
|
where
|
||||||
|
T: TypeFoldable<'tcx>,
|
||||||
|
{
|
||||||
|
self.normalize_with_cause(value, ObligationCause::misc(self.span, hir::CRATE_HIR_ID))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn normalize_with_cause<T>(&mut self, value: T, cause: ObligationCause<'tcx>) -> T
|
||||||
where
|
where
|
||||||
T: TypeFoldable<'tcx>,
|
T: TypeFoldable<'tcx>,
|
||||||
{
|
{
|
||||||
self.infcx
|
self.infcx
|
||||||
.partially_normalize_associated_types_in(
|
.partially_normalize_associated_types_in(cause, self.param_env, value)
|
||||||
ObligationCause::misc(self.span, hir::CRATE_HIR_ID),
|
|
||||||
self.param_env,
|
|
||||||
value,
|
|
||||||
)
|
|
||||||
.into_value_registering_obligations(self.infcx, self.fulfill_cx)
|
.into_value_registering_obligations(self.infcx, self.fulfill_cx)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,6 +157,8 @@ impl<'me, 'tcx> AscribeUserTypeCx<'me, 'tcx> {
|
|||||||
hir::CRATE_HIR_ID,
|
hir::CRATE_HIR_ID,
|
||||||
ObligationCauseCode::AscribeUserTypeProvePredicate(predicate_span),
|
ObligationCauseCode::AscribeUserTypeProvePredicate(predicate_span),
|
||||||
);
|
);
|
||||||
|
let instantiated_predicate =
|
||||||
|
self.normalize_with_cause(instantiated_predicate, cause.clone());
|
||||||
self.prove_predicate(instantiated_predicate, cause);
|
self.prove_predicate(instantiated_predicate, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user