1
Fork 0

Remove ObligationCause::span() method

This commit is contained in:
Michael Goulet 2024-10-27 22:53:14 +00:00
parent 2507e83d7b
commit 7f54b9ecef
9 changed files with 21 additions and 26 deletions

View file

@ -92,16 +92,6 @@ impl<'tcx> ObligationCause<'tcx> {
ObligationCause { span, body_id: CRATE_DEF_ID, code: Default::default() }
}
pub fn span(&self) -> Span {
match *self.code() {
ObligationCauseCode::MatchExpressionArm(box MatchExpressionArmCause {
arm_span,
..
}) => arm_span,
_ => self.span,
}
}
#[inline]
pub fn code(&self) -> &ObligationCauseCode<'tcx> {
&self.code
@ -517,12 +507,17 @@ pub struct MatchExpressionArmCause<'tcx> {
pub prior_arm_block_id: Option<HirId>,
pub prior_arm_ty: Ty<'tcx>,
pub prior_arm_span: Span,
/// Span of the scrutinee of the match (the matched value).
pub scrut_span: Span,
/// Source of the match, i.e. `match` or a desugaring.
pub source: hir::MatchSource,
// Span of the *whole* match expr
/// Span of the *whole* match expr.
pub expr_span: Span,
/// Spans of the previous arms except for those that diverge (i.e. evaluate to `!`).
///
/// These are used for pointing out errors that may affect several arms.
pub prior_non_diverging_arms: Vec<Span>,
// Is the expectation of this match expression an RPIT?
/// Is the expectation of this match expression an RPIT?
pub tail_defines_return_position_impl_trait: Option<LocalDefId>,
}