Skip to content

Commit bb9cb91

Browse files
committed
---
yaml --- r: 97243 b: refs/heads/dist-snap c: 8562229 h: refs/heads/master i: 97241: 72826c4 97239: e5adde9 v: v3
1 parent dbc7f4d commit bb9cb91

File tree

6 files changed

+2
-194
lines changed

6 files changed

+2
-194
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: df25bb65eb56aa3815226c74190079be3904c13c
9+
refs/heads/dist-snap: 856222987d08289ef03a06ebf7b59087e226e9e9
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libextra/num/rational.rs

Lines changed: 1 addition & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use std::cmp;
1515
use std::from_str::FromStr;
1616
use std::num::{Zero,One,ToStrRadix,FromStrRadix,Round};
17-
use super::bigint::{BigInt, BigUint, Sign, Plus, Minus};
17+
use super::bigint::BigInt;
1818

1919
/// Represents the ratio between 2 numbers.
2020
#[deriving(Clone)]
@@ -107,27 +107,6 @@ impl<T: Clone + Integer + Ord>
107107
}
108108
}
109109

110-
impl Ratio<BigInt> {
111-
/// Converts a float into a rational number
112-
pub fn from_float<T: Float>(f: T) -> Option<BigRational> {
113-
if !f.is_finite() {
114-
return None;
115-
}
116-
let (mantissa, exponent, sign) = f.integer_decode();
117-
let bigint_sign: Sign = if sign == 1 { Plus } else { Minus };
118-
if exponent < 0 {
119-
let one: BigInt = One::one();
120-
let denom: BigInt = one << ((-exponent) as uint);
121-
let numer: BigUint = FromPrimitive::from_u64(mantissa).unwrap();
122-
Some(Ratio::new(BigInt::from_biguint(bigint_sign, numer), denom))
123-
} else {
124-
let mut numer: BigUint = FromPrimitive::from_u64(mantissa).unwrap();
125-
numer = numer << (exponent as uint);
126-
Some(Ratio::from_integer(BigInt::from_biguint(bigint_sign, numer)))
127-
}
128-
}
129-
}
130-
131110
/* Comparisons */
132111

133112
// comparing a/b and c/d is the same as comparing a*d and b*c, so we
@@ -642,42 +621,4 @@ mod test {
642621
test(s);
643622
}
644623
}
645-
646-
#[test]
647-
fn test_from_float() {
648-
fn test<T: Float>(given: T, (numer, denom): (&str, &str)) {
649-
let ratio: BigRational = Ratio::from_float(given).unwrap();
650-
assert_eq!(ratio, Ratio::new(
651-
FromStr::from_str(numer).unwrap(),
652-
FromStr::from_str(denom).unwrap()));
653-
}
654-
655-
// f32
656-
test(3.14159265359f32, ("13176795", "4194304"));
657-
test(2f32.pow(&100.), ("1267650600228229401496703205376", "1"));
658-
test(-2f32.pow(&100.), ("-1267650600228229401496703205376", "1"));
659-
test(1.0 / 2f32.pow(&100.), ("1", "1267650600228229401496703205376"));
660-
test(684729.48391f32, ("1369459", "2"));
661-
test(-8573.5918555f32, ("-4389679", "512"));
662-
663-
// f64
664-
test(3.14159265359f64, ("3537118876014453", "1125899906842624"));
665-
test(2f64.pow(&100.), ("1267650600228229401496703205376", "1"));
666-
test(-2f64.pow(&100.), ("-1267650600228229401496703205376", "1"));
667-
test(684729.48391f64, ("367611342500051", "536870912"));
668-
test(-8573.5918555, ("-4713381968463931", "549755813888"));
669-
test(1.0 / 2f64.pow(&100.), ("1", "1267650600228229401496703205376"));
670-
}
671-
672-
#[test]
673-
fn test_from_float_fail() {
674-
use std::{f32, f64};
675-
676-
assert_eq!(Ratio::from_float(f32::NAN), None);
677-
assert_eq!(Ratio::from_float(f32::INFINITY), None);
678-
assert_eq!(Ratio::from_float(f32::NEG_INFINITY), None);
679-
assert_eq!(Ratio::from_float(f64::NAN), None);
680-
assert_eq!(Ratio::from_float(f64::INFINITY), None);
681-
assert_eq!(Ratio::from_float(f64::NEG_INFINITY), None);
682-
}
683624
}

branches/dist-snap/src/librustc/back/link.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
use back::archive::{Archive, METADATA_FILENAME};
1313
use back::rpath;
14-
use back::manifest;
1514
use driver::driver::CrateTranslation;
1615
use driver::session::Session;
1716
use driver::session;
@@ -828,12 +827,6 @@ fn link_binary_output(sess: Session,
828827
}
829828
session::OutputExecutable => {
830829
link_natively(sess, false, obj_filename, &out_filename);
831-
// Windows linker will add an ".exe" extension if there was none
832-
let out_filename = match out_filename.extension() {
833-
Some(_) => out_filename.clone(),
834-
None => out_filename.with_extension(win32::EXE_EXTENSION)
835-
};
836-
manifest::postprocess_executable(sess, &out_filename);
837830
}
838831
session::OutputDylib => {
839832
link_natively(sess, true, obj_filename, &out_filename);

branches/dist-snap/src/librustc/back/manifest.rs

Lines changed: 0 additions & 106 deletions
This file was deleted.

branches/dist-snap/src/librustc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ pub mod front {
8888
pub mod back {
8989
pub mod archive;
9090
pub mod link;
91-
pub mod manifest;
9291
pub mod abi;
9392
pub mod arm;
9493
pub mod mips;

branches/dist-snap/src/test/run-pass/setup.rs

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)