Skip to content

Commit

Permalink
Rollup merge of rust-lang#99994 - TaKO8Ki:remove-guess-head-span, r=f…
Browse files Browse the repository at this point in the history
…ee1-dead

Remove `guess_head_span`

follow-up to rust-lang#98519
  • Loading branch information
matthiaskrgr authored Aug 2, 2022
2 parents 9690852 + a3c2d55 commit 17f76a1
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions compiler/rustc_typeck/src/check/_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,13 +356,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// 6 | | };
// | |_____^ expected integer, found `()`
// ```
if block.expr.is_none() && block.stmts.is_empty() && outer_span.is_some() {
let sp = if let Some(cs) = cond_span.find_ancestor_inside(span) {
span.with_hi(cs.hi())
} else {
span
};
outer_span = Some(sp);
if block.expr.is_none() && block.stmts.is_empty()
&& let Some(outer_span) = &mut outer_span
&& let Some(cond_span) = cond_span.find_ancestor_inside(*outer_span)
{
*outer_span = outer_span.with_hi(cond_span.hi())
}

(self.find_block_span(block), block.hir_id)
Expand Down

0 comments on commit 17f76a1

Please sign in to comment.