blob: 985a6f39cd7ab2d436d520fd6b85cd74092b43c7 (
plain)
1
2
3
4
5
6
7
8
9
|
// run-pass
use std::ops::Add;
extern "C" fn foo<T: Add>(a: T, b: T) -> T::Output { a + b }
fn main() {
assert_eq!(100u8, foo(0u8, 100u8));
assert_eq!(100u16, foo(0u16, 100u16));
}
|