about summary refs log tree commit diff
path: root/src/libcore/num
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2018-10-23 23:09:44 +0200
committerMazdak Farrokhzad <twingoow@gmail.com>2018-11-10 01:10:07 +0100
commite15c62d61fa02fac93992db9297aa4a8a56cef93 (patch)
tree7f1e21f22c66f3d4988fdbf347031bd6d67a3af0 /src/libcore/num
parentd1d2aa22c0d15465af1daccdb3821450c98d0ed0 (diff)
downloadrust-e15c62d61fa02fac93992db9297aa4a8a56cef93.tar.gz
rust-e15c62d61fa02fac93992db9297aa4a8a56cef93.zip
revert making internal APIs const fn.
Diffstat (limited to 'src/libcore/num')
-rw-r--r--src/libcore/num/dec2flt/mod.rs4
-rw-r--r--src/libcore/num/dec2flt/parse.rs2
-rw-r--r--src/libcore/num/dec2flt/rawfp.rs2
-rw-r--r--src/libcore/num/flt2dec/estimator.rs2
4 files changed, 5 insertions, 5 deletions
diff --git a/src/libcore/num/dec2flt/mod.rs b/src/libcore/num/dec2flt/mod.rs
index 0e1f6664d96..f93564c2849 100644
--- a/src/libcore/num/dec2flt/mod.rs
+++ b/src/libcore/num/dec2flt/mod.rs
@@ -187,11 +187,11 @@ impl fmt::Display for ParseFloatError {
     }
 }
 
-const fn pfe_empty() -> ParseFloatError {
+fn pfe_empty() -> ParseFloatError {
     ParseFloatError { kind: FloatErrorKind::Empty }
 }
 
-const fn pfe_invalid() -> ParseFloatError {
+fn pfe_invalid() -> ParseFloatError {
     ParseFloatError { kind: FloatErrorKind::Invalid }
 }
 
diff --git a/src/libcore/num/dec2flt/parse.rs b/src/libcore/num/dec2flt/parse.rs
index 8d8f357425e..e7ed94d4d91 100644
--- a/src/libcore/num/dec2flt/parse.rs
+++ b/src/libcore/num/dec2flt/parse.rs
@@ -39,7 +39,7 @@ pub struct Decimal<'a> {
 }
 
 impl<'a> Decimal<'a> {
-    pub const fn new(integral: &'a [u8], fractional: &'a [u8], exp: i64) -> Decimal<'a> {
+    pub fn new(integral: &'a [u8], fractional: &'a [u8], exp: i64) -> Decimal<'a> {
         Decimal { integral, fractional, exp }
     }
 }
diff --git a/src/libcore/num/dec2flt/rawfp.rs b/src/libcore/num/dec2flt/rawfp.rs
index c5d4aa68958..38f4e4687a9 100644
--- a/src/libcore/num/dec2flt/rawfp.rs
+++ b/src/libcore/num/dec2flt/rawfp.rs
@@ -44,7 +44,7 @@ pub struct Unpacked {
 }
 
 impl Unpacked {
-    pub const fn new(sig: u64, k: i16) -> Self {
+    pub fn new(sig: u64, k: i16) -> Self {
         Unpacked { sig, k }
     }
 }
diff --git a/src/libcore/num/flt2dec/estimator.rs b/src/libcore/num/flt2dec/estimator.rs
index 2a87bf43664..4e33fcfd76e 100644
--- a/src/libcore/num/flt2dec/estimator.rs
+++ b/src/libcore/num/flt2dec/estimator.rs
@@ -15,7 +15,7 @@
 /// This is used to approximate `k = ceil(log_10 (mant * 2^exp))`;
 /// the true `k` is either `k_0` or `k_0+1`.
 #[doc(hidden)]
-pub const fn estimate_scaling_factor(mant: u64, exp: i16) -> i16 {
+pub fn estimate_scaling_factor(mant: u64, exp: i16) -> i16 {
     // 2^(nbits-1) < mant <= 2^nbits if mant > 0
     let nbits = 64 - (mant - 1).leading_zeros() as i64;
     // 1292913986 = floor(2^32 * log_10 2)