From 65e0e30e59351aed899adbb20cbd07ae98f213d3 Mon Sep 17 00:00:00 2001 From: Lindsey Kuper Date: Thu, 2 Aug 2012 15:52:30 -0700 Subject: Make typeck::collect aware of provided methods in traits. --- src/libsyntax/ast_util.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/libsyntax') diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 119f4465d9e..58650e147cc 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -329,6 +329,18 @@ fn trait_method_to_ty_method(method: trait_method) -> ty_method { } } +fn split_trait_methods(trait_methods: ~[trait_method]) + -> (~[ty_method], ~[@method]) { + let mut reqd = ~[], provd = ~[]; + for trait_methods.each |trt_method| { + alt trt_method { + required(tm) { vec::push(reqd, tm); } + provided(m) { vec::push(provd, m); } + } + }; + (reqd, provd) +} + pure fn class_member_visibility(ci: @class_member) -> visibility { alt ci.node { instance_var(_, _, _, _, vis) { vis } -- cgit 1.4.1-3-g733a5