Skip to content

Commit 6c14d7d

Browse files
committed
---
yaml --- r: 277871 b: refs/heads/auto c: ac26419 h: refs/heads/master i: 277869: d32c08d 277867: b9db3c1 277863: b5b7d5f 277855: 50da089
1 parent 300928c commit 6c14d7d

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 6aa91457535a1bc5433eec5f2bc5630e13b04895
11+
refs/heads/auto: ac264196e2f4c1f3de8b081f72dc78838e423085
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/src/librustc/ty/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,14 @@ pub trait NodeIdTree {
290290
impl<'a> NodeIdTree for ast_map::Map<'a> {
291291
fn is_descendant_of(&self, node: NodeId, ancestor: NodeId) -> bool {
292292
let mut node_ancestor = node;
293-
loop {
294-
if node_ancestor == ancestor { return true }
293+
while node_ancestor != ancestor {
295294
let node_ancestor_parent = self.get_module_parent(node_ancestor);
296-
if node_ancestor_parent == node_ancestor { return false }
295+
if node_ancestor_parent == node_ancestor {
296+
return false;
297+
}
297298
node_ancestor = node_ancestor_parent;
298299
}
300+
true
299301
}
300302
}
301303

branches/auto/src/librustc_resolve/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,14 +1125,14 @@ impl<'a, 'tcx> ty::NodeIdTree for Resolver<'a, 'tcx> {
11251125
fn is_descendant_of(&self, node: NodeId, ancestor: NodeId) -> bool {
11261126
let ancestor = self.ast_map.local_def_id(ancestor);
11271127
let mut module = *self.module_map.get(&node).unwrap();
1128-
loop {
1129-
if module.def_id() == Some(ancestor) { return true; }
1128+
while module.def_id() != Some(ancestor) {
11301129
let module_parent = match self.get_nearest_normal_module_parent(module) {
11311130
Some(parent) => parent,
11321131
None => return false,
11331132
};
11341133
module = module_parent;
11351134
}
1135+
true
11361136
}
11371137
}
11381138

0 commit comments

Comments
 (0)