Merge different function exits
This commit is contained in:
parent
9155a9dae5
commit
578da998af
1 changed files with 2 additions and 7 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue