Skip to content

Commit fec3b91

Browse files
committed
In reachability, visit class ctors
1 parent 8972588 commit fec3b91

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/rustc/middle/trans/reachable.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ fn traverse_def_id(cx: ctx, did: def_id) {
6363
ast_map::node_method(_, impl_id, _) { traverse_def_id(cx, impl_id); }
6464
ast_map::node_native_item(item, _, _) { cx.rmap.insert(item.id, ()); }
6565
ast_map::node_variant(v, _, _) { cx.rmap.insert(v.node.id, ()); }
66+
// If it's a class ctor, consider the parent reachable
67+
ast_map::node_ctor(_, _, ast_map::class_ctor(_, parent_id), _) {
68+
traverse_def_id(cx, parent_id);
69+
}
6670
_ {}
6771
}
6872
}

0 commit comments

Comments
 (0)