diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-03-21 12:42:34 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-03-21 13:53:21 -0700 |
| commit | 30c272cb3a42cfd842736ddb90133362fe899290 (patch) | |
| tree | 5daa1ceb5c4570640b5d0a587b89cd350c985d6d /src/rustc/syntax | |
| parent | 3e474424714f8e24fd1237d77cf88a3b35a495e5 (diff) | |
| download | rust-30c272cb3a42cfd842736ddb90133362fe899290.tar.gz rust-30c272cb3a42cfd842736ddb90133362fe899290.zip | |
methods work
Cross-crate method calls don't work yet. Added run-pass/class-method-cross-crate to test that, but it's xfailed References to fields within methods don't work yet. Added run-pass/class-methods to test that, but it's also xfailed
Diffstat (limited to 'src/rustc/syntax')
| -rw-r--r-- | src/rustc/syntax/ast_util.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rustc/syntax/ast_util.rs b/src/rustc/syntax/ast_util.rs index 5625fecb953..7af080a2535 100644 --- a/src/rustc/syntax/ast_util.rs +++ b/src/rustc/syntax/ast_util.rs @@ -17,7 +17,9 @@ fn path_name(p: @path) -> str { path_name_i(p.node.idents) } fn path_name_i(idents: [ident]) -> str { str::connect(idents, "::") } -fn local_def(id: node_id) -> def_id { ret {crate: local_crate, node: id}; } +fn local_def(id: node_id) -> def_id { {crate: local_crate, node: id} } + +pure fn is_local(did: ast::def_id) -> bool { did.crate == local_crate } fn stmt_id(s: stmt) -> node_id { alt s.node { |
