Rollup merge of #80923 - LingMan:exits, r=varkor
Merge different function exits `@rustbot` modify labels +C-cleanup +T-compiler
This commit is contained in:
commit
4e69c5d0fa
@ -710,15 +710,10 @@ pub fn get_defining_scope(&self, id: HirId) -> HirId {
|
||||
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