2012-07-31 10:27:51 -07:00
|
|
|
trait foo { fn foo(); }
|
2012-07-18 11:01:54 -07:00
|
|
|
|
2012-09-07 14:52:28 -07:00
|
|
|
fn to_foo<T: Copy foo>(t: T) -> foo {
|
2012-07-18 11:01:54 -07:00
|
|
|
t as foo //~ ERROR value may contain borrowed pointers; use `owned` bound
|
|
|
|
}
|
|
|
|
|
2012-09-07 14:52:28 -07:00
|
|
|
fn to_foo2<T: Copy foo Owned>(t: T) -> foo {
|
2012-07-18 11:01:54 -07:00
|
|
|
t as foo
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|