trait clam { fn chowder(y: A); } struct foo { x: A, } impl foo : clam { fn chowder(y: A) { } } fn foo(b: A) -> foo { foo { x: b } } fn f(x: clam, a: A) { x.chowder(a); } fn main() { let c = foo(42); let d: clam = c as clam::; f(d, c.x); }