summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/inheritance/num1.rs
blob: 663dd3a5eafdb79e5066a0c6df695f63d2275d72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// run-pass
#![allow(dead_code)]
// pretty-expanded FIXME #23616

pub trait NumCast: Sized {
    fn from(i: i32) -> Option<Self>;
}

pub trait NumExt: NumCast + PartialOrd { }

fn greater_than_one<T:NumExt>(n: &T) -> bool {
    *n > NumCast::from(1).unwrap()
}

pub fn main() {}