//@ run-pass #![allow(non_camel_case_types)] trait bar { fn get_bar(&self) -> T; } fn foo>(b: U) -> T { b.get_bar() } struct cbar { x: isize, } impl bar for cbar { fn get_bar(&self) -> isize { self.x } } fn cbar(x: isize) -> cbar { cbar { x: x } } pub fn main() { let x: isize = foo::(cbar(5)); assert_eq!(x, 5); }