diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2012-10-12 17:00:08 -0700 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2012-10-12 17:46:43 -0700 |
| commit | cb55e246ba517a14eaabb82cba3294ab4ad23c0a (patch) | |
| tree | e2c9dd4e2183de97b01c81c08b71d0b46a471e1a /src/libsyntax | |
| parent | 57b4d10ff652d3beddae64782c882a07822bac3c (diff) | |
| download | rust-cb55e246ba517a14eaabb82cba3294ab4ad23c0a.tar.gz rust-cb55e246ba517a14eaabb82cba3294ab4ad23c0a.zip | |
Use the Nth impl when translating a static method call, instead
of the 0th. 0th is only correct when there are no bound tps on the trait. Fixes #3741.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 9 | ||||
| -rw-r--r-- | src/libsyntax/ast_util.rs | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 435f52b4bf8..4b945494293 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -118,7 +118,9 @@ type ty_param = {ident: ident, id: node_id, bounds: @~[ty_param_bound]}; #[auto_deserialize] enum def { def_fn(def_id, purity), - def_static_method(def_id, purity), + def_static_method(/* method */ def_id, + /* trait */ def_id, + purity), def_self(node_id), def_mod(def_id), def_foreign_mod(def_id), @@ -150,9 +152,10 @@ impl def : cmp::Eq { _ => false } } - def_static_method(e0a, e1a) => { + def_static_method(e0a, e1a, e2a) => { match (*other) { - def_static_method(e0b, e1b) => e0a == e0b && e1a == e1b, + def_static_method(e0b, e1b, e2b) => + e0a == e0b && e1a == e1b && e2a == e2b, _ => false } } diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 31ddcfafa2d..35b9e8d40c0 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -54,7 +54,7 @@ fn variant_def_ids(d: def) -> {enm: def_id, var: def_id} { pure fn def_id_of_def(d: def) -> def_id { match d { - def_fn(id, _) | def_static_method(id, _) | def_mod(id) | + def_fn(id, _) | def_static_method(id, _, _) | def_mod(id) | def_foreign_mod(id) | def_const(id) | def_variant(_, id) | def_ty(id) | def_ty_param(id, _) | def_use(id) | def_class(id, _) => { |
