diff options
| author | Lindsey Kuper <lindsey@rockstargirl.org> | 2012-08-02 15:52:30 -0700 |
|---|---|---|
| committer | Lindsey Kuper <lindsey@rockstargirl.org> | 2012-08-02 17:15:36 -0700 |
| commit | 65e0e30e59351aed899adbb20cbd07ae98f213d3 (patch) | |
| tree | 5bb12d679c68a9f9ab2ac2df52aab2a38c6a3dfd /src/libsyntax | |
| parent | 2fe299d1a53355c9bb78b9067bd2d18bd4eb94e7 (diff) | |
Make typeck::collect aware of provided methods in traits.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast_util.rs | 12 |
1 files changed, 12 insertions, 0 deletions
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 } |
