Skip to content

Commit 101e027

Browse files
committed
---
yaml --- r: 42074 b: refs/heads/master c: 15871a7 h: refs/heads/master v: v3
1 parent 2b25b49 commit 101e027

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 91676f3fa699c3d715c5420b5c8c0828627aa09e
2+
refs/heads/master: 15871a7458feee550c9ba65db802ed0fb5db2ae7
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
55
refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650

trunk/src/librustc/middle/lint.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,18 @@ fn check_item_heap(cx: ty::ctxt, it: @ast::item) {
786786
_ => ()
787787
}
788788
789+
// If it's a struct, we also have to check the fields' types
790+
match it.node {
791+
ast::item_struct(struct_def, _) => {
792+
for struct_def.fields.each |struct_field| {
793+
check_type(cx, struct_field.node.id, it.id,
794+
struct_field.span,
795+
ty::node_id_to_type(cx, struct_field.node.id));
796+
}
797+
}
798+
_ => ()
799+
}
800+
789801
let visit = item_stopping_visitor(
790802
visit::mk_simple_visitor(@visit::SimpleVisitor {
791803
visit_expr: |e: @ast::expr| {

0 commit comments

Comments
 (0)