about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2012-04-19 16:19:53 -0700
committerTim Chevalier <chevalier@alum.wellesley.edu>2012-04-19 16:21:15 -0700
commitb0074c5a92a5b4bcfbb936d3877cc50b1cf8df90 (patch)
treed79108d6f249656a04dd451b9b44fe6e900eb0e8 /src/libcore
parent1e51196f3356ebcc854522a240921d33d95886b3 (diff)
downloadrust-b0074c5a92a5b4bcfbb936d3877cc50b1cf8df90.tar.gz
rust-b0074c5a92a5b4bcfbb936d3877cc50b1cf8df90.zip
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.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/float.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcore/float.rs b/src/libcore/float.rs
index 7d0143da888..5730c656227 100644
--- a/src/libcore/float.rs
+++ b/src/libcore/float.rs
@@ -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;