Consolidate obligation cause codes for where clauses

This commit is contained in:
Michael Goulet
2024-05-10 11:04:53 -04:00
parent ef15976387
commit e444017b49
25 changed files with 137 additions and 139 deletions

View File

@@ -568,11 +568,7 @@ impl<'a, 'tcx> WfPredicates<'a, 'tcx> {
iter::zip(predicates, origins.into_iter().rev())
.map(|((pred, span), origin_def_id)| {
let code = if span.is_dummy() {
ObligationCauseCode::WhereClause(origin_def_id)
} else {
ObligationCauseCode::SpannedWhereClause(origin_def_id, span)
};
let code = ObligationCauseCode::WhereClause(origin_def_id, span);
let cause = self.cause(code);
traits::Obligation::with_depth(
self.tcx(),