2012-07-16 20:17:57 -07:00
|
|
|
fn copy1<T: copy>(t: T) -> fn@() -> T {
|
2012-07-18 11:01:54 -07:00
|
|
|
fn@() -> T { t } //~ ERROR value may contain borrowed pointers
|
2012-07-16 20:17:57 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
fn copy2<T: copy owned>(t: T) -> fn@() -> T {
|
|
|
|
fn@() -> T { t }
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = &3;
|
2012-07-18 11:01:54 -07:00
|
|
|
copy2(&x); //~ ERROR missing `owned`
|
2012-07-16 20:17:57 -07:00
|
|
|
|
|
|
|
copy2(@3);
|
2012-07-18 11:01:54 -07:00
|
|
|
copy2(@&x); //~ ERROR missing `owned`
|
2012-07-16 20:17:57 -07:00
|
|
|
|
|
|
|
copy2(fn@() {});
|
|
|
|
copy2(fn~() {}); //~ WARNING instantiating copy type parameter with a not implicitly copyable type
|
2012-07-18 11:01:54 -07:00
|
|
|
copy2(fn&() {}); //~ ERROR missing `copy owned`
|
2012-07-16 20:17:57 -07:00
|
|
|
}
|