Skip to content

Commit 1eb71f0

Browse files
committed
Add back in normalize call
1 parent e09242d commit 1eb71f0

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

compiler/rustc_traits/src/type_op.rs

+10-5
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,18 @@ struct AscribeUserTypeCx<'me, 'tcx> {
7676

7777
impl<'me, 'tcx> AscribeUserTypeCx<'me, 'tcx> {
7878
fn normalize<T>(&mut self, value: T) -> T
79+
where
80+
T: TypeFoldable<'tcx>,
81+
{
82+
self.normalize_with_cause(value, ObligationCause::misc(self.span, hir::CRATE_HIR_ID))
83+
}
84+
85+
fn normalize_with_cause<T>(&mut self, value: T, cause: ObligationCause<'tcx>) -> T
7986
where
8087
T: TypeFoldable<'tcx>,
8188
{
8289
self.infcx
83-
.partially_normalize_associated_types_in(
84-
ObligationCause::misc(self.span, hir::CRATE_HIR_ID),
85-
self.param_env,
86-
value,
87-
)
90+
.partially_normalize_associated_types_in(cause, self.param_env, value)
8891
.into_value_registering_obligations(self.infcx, self.fulfill_cx)
8992
}
9093

@@ -154,6 +157,8 @@ impl<'me, 'tcx> AscribeUserTypeCx<'me, 'tcx> {
154157
hir::CRATE_HIR_ID,
155158
ObligationCauseCode::AscribeUserTypeProvePredicate(predicate_span),
156159
);
160+
let instantiated_predicate =
161+
self.normalize_with_cause(instantiated_predicate, cause.clone());
157162
self.prove_predicate(instantiated_predicate, cause);
158163
}
159164

0 commit comments

Comments
 (0)