to_opt_poly_X_pred -> as_X_clause

This commit is contained in:
Michael Goulet
2024-05-15 12:58:41 -04:00
parent 550d1b4fb6
commit 2025e44ef8
9 changed files with 23 additions and 23 deletions

View File

@@ -1350,12 +1350,12 @@ fn check_impl<'tcx>(
// We already have a better span.
continue;
}
if let Some(pred) = obligation.predicate.to_opt_poly_trait_pred()
if let Some(pred) = obligation.predicate.as_trait_clause()
&& pred.skip_binder().self_ty() == trait_ref.self_ty()
{
obligation.cause.span = hir_self_ty.span;
}
if let Some(pred) = obligation.predicate.to_opt_poly_projection_pred()
if let Some(pred) = obligation.predicate.as_projection_clause()
&& pred.skip_binder().self_ty() == trait_ref.self_ty()
{
obligation.cause.span = hir_self_ty.span;