diff options
| author | Michael Goulet <michael@errs.io> | 2024-10-27 22:53:14 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-10-27 23:54:06 +0000 |
| commit | 7f54b9ecefc38a8a3fde9a98b253eeb6f775b25a (patch) | |
| tree | 87216840ffc8864ea7ca174b39f85d3ab8c526e4 /compiler/rustc_middle/src/traits/mod.rs | |
| parent | 2507e83d7bb0dd9e7217b10b13afc61763dc1eca (diff) | |
| download | rust-7f54b9ecefc38a8a3fde9a98b253eeb6f775b25a.tar.gz rust-7f54b9ecefc38a8a3fde9a98b253eeb6f775b25a.zip | |
Remove ObligationCause::span() method
Diffstat (limited to 'compiler/rustc_middle/src/traits/mod.rs')
| -rw-r--r-- | compiler/rustc_middle/src/traits/mod.rs | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/compiler/rustc_middle/src/traits/mod.rs b/compiler/rustc_middle/src/traits/mod.rs index 7237a7014e8..40e5ec45959 100644 --- a/compiler/rustc_middle/src/traits/mod.rs +++ b/compiler/rustc_middle/src/traits/mod.rs @@ -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>, } |
