rust/src/test/run-pass/trait-inheritance-num1.rs

13 lines
182 B
Rust
Raw Normal View History

// Using the real Num from core
use cmp::Ord;
use num::from_int;
pub trait NumExt: Num Ord { }
fn greater_than_one<T:NumExt>(n: &T) -> bool {
*n > from_int(1)
}
fn main() {}