diff options
| author | Patrick Walton <[email protected]> | 2011-03-09 13:07:06 -0800 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2011-03-09 13:07:06 -0800 |
| commit | 9aa26904b83266576f9a05d5b1b9ca99b8ed0533 (patch) | |
| tree | d8b91a9d4cbfff1d45ae9b9edbc6ec30c71f0624 /src/comp | |
| parent | rustc: Perform type parameter substitutions in static_size_of_tag() (diff) | |
| download | rust-9aa26904b83266576f9a05d5b1b9ca99b8ed0533.tar.xz rust-9aa26904b83266576f9a05d5b1b9ca99b8ed0533.zip | |
rustc: Remove redundant ty_params_of_tag() function
Diffstat (limited to 'src/comp')
| -rw-r--r-- | src/comp/middle/trans.rs | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index ae9e408b..06378927 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -923,18 +923,6 @@ fn align_of(@block_ctxt cx, @ty.t t) -> result { ret dynamic_align_of(cx, t); } -// Returns the type parameters associated with the tag with the given ID. -fn ty_params_of_tag(@crate_ctxt cx, &ast.def_id tid) -> vec[ast.ty_param] { - alt (cx.items.get(tid).node) { - case (ast.item_tag(_, _, ?tps, _)) { ret tps; } - case (_) { - log "ty_params_of_tag(): tag ID doesn't actually refer to a " + - "tag item"; - fail; - } - } -} - // Computes the size of the data part of a non-dynamically-sized tag. fn static_size_of_tag(@crate_ctxt cx, @ty.t t) -> uint { if (ty.type_has_dynamic_size(t)) { @@ -960,7 +948,7 @@ fn static_size_of_tag(@crate_ctxt cx, @ty.t t) -> uint { } // Pull the type parameters out of the corresponding tag item. - let vec[ast.ty_param] ty_params = ty_params_of_tag(cx, tid); + let vec[ast.ty_param] ty_params = tag_ty_params(cx, tid); // Compute max(variant sizes). auto max_size = 0u; |