diff options
Diffstat (limited to 'tests/ui/traits/inheritance/num1.rs')
-rw-r--r-- | tests/ui/traits/inheritance/num1.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/traits/inheritance/num1.rs b/tests/ui/traits/inheritance/num1.rs new file mode 100644 index 000000000..663dd3a5e --- /dev/null +++ b/tests/ui/traits/inheritance/num1.rs @@ -0,0 +1,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() {} |