trait Foo { fn foo(); } struct Bar impls Foo { } fn test(f: impl Foo) { } x = Bar {} test(x)