Skip to content

Commit 300e2b8

Browse files
committed
Start adding infrastructure for checking trait method bodies.
1 parent d747cd7 commit 300e2b8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/rustc/middle/typeck/check.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,21 @@ fn check_item(ccx: @crate_ctxt, it: @ast::item) {
419419
node_id: it.id };
420420
for ms.each |m| { check_method(ccx, m, self_info);}
421421
}
422+
ast::item_trait(_, trait_methods) {
423+
for trait_methods.each |trait_method| {
424+
alt trait_method {
425+
required(ty_m) {
426+
// Nothing to do, since required methods don't have
427+
// bodies to check.
428+
}
429+
provided(m) {
430+
let self_info = {self_ty: ty::mk_self(ccx.tcx),
431+
node_id: it.id};
432+
check_method(ccx, m, self_info);
433+
}
434+
}
435+
}
436+
}
422437
ast::item_class(tps, traits, members, m_ctor, m_dtor) {
423438
let tcx = ccx.tcx;
424439
let class_t = {self_ty: ty::node_id_to_type(tcx, it.id),

0 commit comments

Comments
 (0)