// check-pass pub trait Build { type Output; fn build(self, input: O) -> Self::Output; } pub struct IdentityBuild; impl Build for IdentityBuild { type Output = O; fn build(self, input: O) -> Self::Output { input } } fn a() { let _x: u8 = IdentityBuild.build(10); } fn b() { let _x: Vec = IdentityBuild.build(Vec::new()); } fn c() { let mut f = IdentityBuild.build(|| ()); (f)(); } pub fn main() { a(); b(); c(); }