diff options
| author | bors <bors@rust-lang.org> | 2024-10-28 07:14:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-10-28 07:14:11 +0000 |
| commit | 66701c42263042f7120385725606edeb987ad4f1 (patch) | |
| tree | 96dfa9e60522906eb23e41080cc1d6b54f6ed896 /compiler/rustc_middle/src | |
| parent | 6929a48275547ef2aae72b85b5b5d8e4acbb5067 (diff) | |
| parent | 3e3feac7c3c6e3561b7a452e3764810f2edd1c33 (diff) | |
| download | rust-66701c42263042f7120385725606edeb987ad4f1.tar.gz rust-66701c42263042f7120385725606edeb987ad4f1.zip | |
Auto merge of #132251 - jieyouxu:rollup-mtv9mpd, r=jieyouxu
Rollup of 7 pull requests Successful merges: - #131633 (error on alignments greater than `isize::MAX`) - #132086 (Tweak E0277 highlighting and "long type" path printing) - #132220 (Add GUI regression test for doc struct fields margins) - #132225 (Dynamically link run-make support) - #132227 (Pass constness with span into lower_poly_trait_ref) - #132242 (Support `char::is_digit` in const contexts.) - #132243 (Remove `ObligationCause::span()` method) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/traits/mod.rs | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/compiler/rustc_middle/src/traits/mod.rs b/compiler/rustc_middle/src/traits/mod.rs index 8ee8b4c4823..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,10 +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. + 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>, } |
