mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
10 lines
192 B
Rust
10 lines
192 B
Rust
//@ 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));
|
|
}
|