Merge different function exits

This commit is contained in:
LingMan 2021-01-10 14:38:14 +01:00
parent 9155a9dae5
commit 578da998af

View File

@ -710,15 +710,10 @@ impl<'hir> Map<'hir> {
let mut scope = id;
loop {
scope = self.get_enclosing_scope(scope).unwrap_or(CRATE_HIR_ID);
if scope == CRATE_HIR_ID {
return CRATE_HIR_ID;
}
match self.get(scope) {
Node::Block(_) => {}
_ => break,
if scope == CRATE_HIR_ID || !matches!(self.get(scope), Node::Block(_)) {
return scope;
}
}
scope
}
pub fn get_parent_did(&self, id: HirId) -> LocalDefId {