Inline get_node_fn_decl into get_fn_decl, simplify/explain logic in report_return_mismatched_types
This commit is contained in:
parent
b826eb219c
commit
a2a6fe7e51
10 changed files with 123 additions and 120 deletions
|
@ -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;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue