Disallow rebinding / matching against consts in alts

As per Issue #1193. Closes #1193.

I had to rename a few variables ("info" and "epsilon") to avoid
clashing with in-scope constants, which is responsible for all the
changes other than resolve and issue-1193.rs.
This commit is contained in:
Tim Chevalier
2012-04-19 16:19:53 -07:00
parent 1e51196f33
commit b0074c5a92
7 changed files with 65 additions and 48 deletions

View File

@@ -51,10 +51,10 @@ fn to_str_common(num: float, digits: uint, exact: bool) -> str {
if (frac < epsilon && !exact) || digits == 0u { ret accum; }
accum += ".";
let mut i = digits;
let mut epsilon = 1. / pow_with_uint(10u, i);
while i > 0u && (frac >= epsilon || exact) {
let mut epsilon_prime = 1. / pow_with_uint(10u, i);
while i > 0u && (frac >= epsilon_prime || exact) {
frac *= 10.0;
epsilon *= 10.0;
epsilon_prime *= 10.0;
let digit = frac as uint;
accum += uint::str(digit);
frac -= digit as float;