]> git.proxmox.com Git - rustc.git/blame - src/test/ui/traits/trait-inheritance-num1.rs
New upstream version 1.51.0+dfsg1
[rustc.git] / src / test / ui / traits / trait-inheritance-num1.rs
CommitLineData
b7449926 1// run-pass
0bf4aa26 2#![allow(dead_code)]
c34b1796
AL
3// pretty-expanded FIXME #23616
4
9cc50fc6 5pub trait NumCast: Sized {
9346a6ac
AL
6 fn from(i: i32) -> Option<Self>;
7}
223e47cc 8
1a4d82fc 9pub trait NumExt: NumCast + PartialOrd { }
223e47cc
LB
10
11fn greater_than_one<T:NumExt>(n: &T) -> bool {
85aaf69f 12 *n > NumCast::from(1).unwrap()
223e47cc
LB
13}
14
15pub fn main() {}