1
Fork 0

libcore: Move the numeric operations out of Num. r=brson

Sadly I could not use trait inheritance due to a type parameter substitution
bug.
This commit is contained in:
Patrick Walton 2013-02-12 17:07:26 -08:00
parent 6efa3543a8
commit 216e85fadf
15 changed files with 165 additions and 118 deletions

View file

@ -11,7 +11,7 @@
use cmp::{Eq, Ord};
use num::NumCast::from;
pub trait NumExt: Eq Ord Num NumCast {}
pub trait NumExt: Eq Ord NumCast {}
pub impl f32: NumExt {}
@ -19,4 +19,4 @@ fn num_eq_one<T:NumExt>(n: T) { io::println(fmt!("%?", n == from(1))) }
pub fn main() {
num_eq_one(1f32); // you need to actually use the function to trigger the ICE
}
}