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:
parent
6efa3543a8
commit
216e85fadf
15 changed files with 165 additions and 118 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue