diff options
| author | Kevin Atkinson <kevina@cs.utah.edu> | 2012-01-16 21:04:02 -0700 |
|---|---|---|
| committer | Kevin Atkinson <kevina@cs.utah.edu> | 2012-01-16 21:04:02 -0700 |
| commit | bdc8e8d222eebebcbc9fcfbc1df03ee8b57892f5 (patch) | |
| tree | fb5a78cf18426aba64b9a5d5348d943017fb506b /src | |
| parent | e20d90671856ac9935ea42281b669eee891a984d (diff) | |
| download | rust-bdc8e8d222eebebcbc9fcfbc1df03ee8b57892f5.tar.gz rust-bdc8e8d222eebebcbc9fcfbc1df03ee8b57892f5.zip | |
Minor cleanups to custom discriminator code.
Mostly updates to the comments and docs from Pull Request #1537.
Diffstat (limited to 'src')
| -rw-r--r-- | src/comp/middle/ty.rs | 4 | ||||
| -rw-r--r-- | src/comp/middle/typeck.rs | 4 | ||||
| -rw-r--r-- | src/test/run-pass/enum-disr-val-pretty.rs | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index d44b0ee0072..478888c99c7 100644 --- a/src/comp/middle/ty.rs +++ b/src/comp/middle/ty.rs @@ -2636,8 +2636,8 @@ fn tag_variants(cx: ctxt, id: ast::def_id) -> @[variant_info] { @csearch::get_tag_variants(cx, id) } else { // FIXME: Now that the variants are run through the type checker (to - // check the disr_expr if one exists), this code should likely be - // moved there to avoid having to call eval_const_expr twice + // check the disr_expr if it exists), this code should likely be + // moved there to avoid having to call eval_const_expr twice. alt cx.items.get(id.node) { ast_map::node_item(@{node: ast::item_tag(variants, _), _}) { let disr_val = -1; diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs index c7736056a50..423d32bd4f6 100644 --- a/src/comp/middle/typeck.rs +++ b/src/comp/middle/typeck.rs @@ -2488,8 +2488,8 @@ fn check_tag_variants(ccx: @crate_ctxt, _sp: span, vs: [ast::variant], demand::simple(fcx, e.span, declty, cty); // FIXME: issue #1417 // Also, check_expr (from check_const pass) doesn't guarantee that - // the expression in an form that eval_const_expr, so we may still - // get an internal compiler error + // the expression in an form that eval_const_expr can handle, so + // we may still get an internal compiler error. alt syntax::ast_util::eval_const_expr(e) { syntax::ast_util::const_int(val) { disr_val = val as int; diff --git a/src/test/run-pass/enum-disr-val-pretty.rs b/src/test/run-pass/enum-disr-val-pretty.rs index 68226f63a2f..d051aa233d6 100644 --- a/src/test/run-pass/enum-disr-val-pretty.rs +++ b/src/test/run-pass/enum-disr-val-pretty.rs @@ -9,7 +9,7 @@ fn main() { test_color(imaginary, -1, "imaginary"); } -fn test_color(color: color, val: int, name: str) unsafe{ +fn test_color(color: color, val: int, name: str) { assert (color as int == val); assert (color as float == val as float); } |
