aboutsummaryrefslogtreecommitdiff
path: root/src/comp/front/extfmt.rs
diff options
context:
space:
mode:
authorBrian Anderson <[email protected]>2011-03-06 13:56:38 -0500
committerGraydon Hoare <[email protected]>2011-03-06 15:13:35 -0800
commitd39da6f97819becd9ea41c194b5f0daa178814fe (patch)
tree71f4f00e321803d1cf9ab61de31a8725d6befeb6 /src/comp/front/extfmt.rs
parentFlatten conditionals in rustc.rs. Remove FIXME (diff)
downloadrust-d39da6f97819becd9ea41c194b5f0daa178814fe.tar.xz
rust-d39da6f97819becd9ea41c194b5f0daa178814fe.zip
Remove typestate workarounds
Diffstat (limited to 'src/comp/front/extfmt.rs')
-rw-r--r--src/comp/front/extfmt.rs17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/comp/front/extfmt.rs b/src/comp/front/extfmt.rs
index 7201a17c..255614d0 100644
--- a/src/comp/front/extfmt.rs
+++ b/src/comp/front/extfmt.rs
@@ -244,9 +244,7 @@ fn parse_count(str s, uint i, uint lim) -> tup(count, uint) {
ret tup(count_implied, i);
}
- // FIXME: These inner functions are just to avoid a rustboot
- // "Unsatisfied precondition constraint" bug with alts nested in ifs
- fn parse_star_count(str s, uint i, uint lim) -> tup(count, uint) {
+ if (s.(i) == ('*' as u8)) {
auto param = parse_parameter(s, i + 1u, lim);
auto j = param._1;
alt (param._0) {
@@ -257,9 +255,7 @@ fn parse_count(str s, uint i, uint lim) -> tup(count, uint) {
ret tup(count_is_param(n), j);
}
}
- }
-
- fn parse_count_(str s, uint i, uint lim) -> tup(count, uint) {
+ } else {
auto num = peek_num(s, i, lim);
alt (num) {
case (none[tup(uint, uint)]) {
@@ -270,12 +266,6 @@ fn parse_count(str s, uint i, uint lim) -> tup(count, uint) {
}
}
}
-
- if (s.(i) == ('*' as u8)) {
- ret parse_star_count(s, i, lim);
- } else {
- ret parse_count_(s, i, lim);
- }
}
fn parse_precision(str s, uint i, uint lim) -> tup(count, uint) {
@@ -318,9 +308,6 @@ fn parse_type(str s, uint i, uint lim) -> tup(ty, uint) {
} else if (_str.eq(tstr, "t")) {
t = ty_bits;
} else {
- // FIXME: This is a hack to avoid 'unsatisfied precondition
- // constraint' on uninitialized variable t below
- t = ty_bool;
log "unknown type in conversion";
fail;
}