提交 15871a74 编写于 作者: T Tim Chevalier

rustc: Check struct field types when heap memory lint checks are enabled

上级 91676f3f
......@@ -786,6 +786,18 @@ fn check_type(cx: ty::ctxt,
_ => ()
}
// If it's a struct, we also have to check the fields' types
match it.node {
ast::item_struct(struct_def, _) => {
for struct_def.fields.each |struct_field| {
check_type(cx, struct_field.node.id, it.id,
struct_field.span,
ty::node_id_to_type(cx, struct_field.node.id));
}
}
_ => ()
}
let visit = item_stopping_visitor(
visit::mk_simple_visitor(@visit::SimpleVisitor {
visit_expr: |e: @ast::expr| {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册