mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Merge different function exits
This commit is contained in:
parent
9155a9dae5
commit
578da998af
@ -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…
Reference in New Issue
Block a user