trait foo { fn foo(); } fn to_foo(t: T) -> foo { t as foo //~ ERROR value may contain borrowed pointers; use `owned` bound } fn to_foo2(t: T) -> foo { t as foo } fn main() {}