1 2 3 4 5 6 7 8 9 10
// run-pass use std::ops::Add; fn f<T: Add>(a: T, b: T) -> <T as Add>::Output { a + b } fn main() { println!("a + b is {}", f::<f32>(100f32, 200f32)); }