Add AscribeUserTypeProvePredicate

This commit is contained in:
Jack Huey
2022-09-16 17:20:11 -04:00
parent ec17be2656
commit 9929c0ac76
5 changed files with 48 additions and 2 deletions

View File

@@ -188,6 +188,9 @@ impl<'tcx> ObligationCause<'tcx> {
pub fn to_constraint_category(&self) -> ConstraintCategory<'tcx> {
match self.code() {
MatchImpl(cause, _) => cause.to_constraint_category(),
AscribeUserTypeProvePredicate(predicate_span) => {
ConstraintCategory::Predicate(*predicate_span)
}
_ => ConstraintCategory::BoringNoLocation,
}
}
@@ -426,6 +429,8 @@ pub enum ObligationCauseCode<'tcx> {
is_lit: bool,
output_ty: Option<Ty<'tcx>>,
},
AscribeUserTypeProvePredicate(Span),
}
/// The 'location' at which we try to perform HIR-based wf checking.