1
Fork 0

Inline get_node_fn_decl into get_fn_decl, simplify/explain logic in report_return_mismatched_types

This commit is contained in:
Michael Goulet 2024-04-11 13:40:16 -04:00
parent b826eb219c
commit a2a6fe7e51
10 changed files with 123 additions and 120 deletions

View file

@ -549,7 +549,11 @@ impl<'hir> Map<'hir> {
Node::Block(Block { expr: None, .. }) => return None,
// The current node is not the tail expression of its parent.
Node::Block(Block { expr: Some(e), .. }) if hir_id != e.hir_id => return None,
Node::Block(Block { expr: Some(e), ..}) if matches!(e.kind, ExprKind::If(_, _, None)) => return None,
Node::Block(Block { expr: Some(e), .. })
if matches!(e.kind, ExprKind::If(_, _, None)) =>
{
return None;
}
_ => {}
}
}