diff options
| author | Patrick Walton <[email protected]> | 2011-04-01 13:02:44 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2011-04-01 13:02:44 -0700 |
| commit | 6dc452335a410e139220c4ecadbbda9dd15fe8e2 (patch) | |
| tree | 96d3fe1107c175f3792eb960cf3d9b9cc87731b7 /src/comp/middle/trans.rs | |
| parent | rustc: Have tag_variants() return a new variant_info structure instead of an ... (diff) | |
| download | rust-6dc452335a410e139220c4ecadbbda9dd15fe8e2.tar.xz rust-6dc452335a410e139220c4ecadbbda9dd15fe8e2.zip | |
rustc: Get tag variants from the crate metadata
Diffstat (limited to 'src/comp/middle/trans.rs')
| -rw-r--r-- | src/comp/middle/trans.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 263ac940..7859393e 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -1911,7 +1911,10 @@ type variant_info = rec(vec[@ty.t] args, @ty.t ctor_ty, ast.def_id id); // Returns information about the variants in a tag. fn tag_variants(@crate_ctxt cx, ast.def_id id) -> vec[variant_info] { - // FIXME: This doesn't work for external variants. + if (cx.sess.get_targ_crate_num() != id._0) { + ret creader.get_tag_variants(cx.sess, id); + } + check (cx.items.contains_key(id)); alt (cx.items.get(id).node) { case (ast.item_tag(_, ?variants, _, _, _)) { |