test: Fix tests.
This commit is contained in:
parent
08e561ae70
commit
db518ef68a
20 changed files with 55 additions and 42 deletions
|
@ -9,13 +9,15 @@
|
|||
// except according to those terms.
|
||||
|
||||
use core::cmp::{Eq, Ord};
|
||||
use core::num::NumCast::from;
|
||||
use core::num::NumCast;
|
||||
|
||||
pub trait NumExt: Eq + Ord + Num + NumCast {}
|
||||
|
||||
impl NumExt for f32 {}
|
||||
|
||||
fn num_eq_one<T:NumExt>(n: T) { io::println(fmt!("%?", n == from(1))) }
|
||||
fn num_eq_one<T:NumExt>(n: T) {
|
||||
io::println(fmt!("%?", n == NumCast::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