Skip to content

Commit 17f76a1

Browse files
authored
Rollup merge of rust-lang#99994 - TaKO8Ki:remove-guess-head-span, r=fee1-dead
Remove `guess_head_span` follow-up to rust-lang#98519
2 parents 9690852 + a3c2d55 commit 17f76a1

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

compiler/rustc_typeck/src/check/_match.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -356,13 +356,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
356356
// 6 | | };
357357
// | |_____^ expected integer, found `()`
358358
// ```
359-
if block.expr.is_none() && block.stmts.is_empty() && outer_span.is_some() {
360-
let sp = if let Some(cs) = cond_span.find_ancestor_inside(span) {
361-
span.with_hi(cs.hi())
362-
} else {
363-
span
364-
};
365-
outer_span = Some(sp);
359+
if block.expr.is_none() && block.stmts.is_empty()
360+
&& let Some(outer_span) = &mut outer_span
361+
&& let Some(cond_span) = cond_span.find_ancestor_inside(*outer_span)
362+
{
363+
*outer_span = outer_span.with_hi(cond_span.hi())
366364
}
367365

368366
(self.find_block_span(block), block.hir_id)

0 commit comments

Comments
 (0)