Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sanxiyn committed Dec 27, 2014
1 parent 9449161 commit fbda51e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/librustc_resolve/lib.rs
Expand Up @@ -3913,6 +3913,8 @@ impl<'a> Resolver<'a> {
}
}

/// Searches the current set of local scopes and
/// applies translations for closures.
fn search_ribs(&self,
ribs: &[Rib],
name: Name,
Expand All @@ -3934,6 +3936,8 @@ impl<'a> Resolver<'a> {
None
}

/// Searches the current set of local scopes for labels.
/// Stops after meeting a closure.
fn search_label(&self, name: Name) -> Option<DefLike> {
for rib in self.label_ribs.iter().rev() {
match rib.kind {
Expand All @@ -3946,13 +3950,8 @@ impl<'a> Resolver<'a> {
}
}
let result = rib.bindings.get(&name).cloned();
match result {
Some(_) => {
return result
}
None => {
// Continue
}
if result.is_some() {
return result
}
}
None
Expand Down

0 comments on commit fbda51e

Please sign in to comment.