2015-01-08 02:53:58 +00:00
|
|
|
#![feature(box_syntax)]
|
2014-05-06 01:56:44 +00:00
|
|
|
|
2012-12-10 19:58:37 +00:00
|
|
|
struct S {
|
2015-01-08 10:54:35 +00:00
|
|
|
x: Box<isize>,
|
2012-12-10 19:58:37 +00:00
|
|
|
}
|
|
|
|
|
2013-05-31 22:17:22 +00:00
|
|
|
impl S {
|
2015-01-08 10:54:35 +00:00
|
|
|
pub fn foo(self) -> isize {
|
2013-01-10 18:59:58 +00:00
|
|
|
self.bar();
|
2014-09-13 02:03:34 +00:00
|
|
|
return *self.x; //~ ERROR use of moved value: `*self.x`
|
2012-12-10 19:58:37 +00:00
|
|
|
}
|
|
|
|
|
2013-05-31 22:17:22 +00:00
|
|
|
pub fn bar(self) {}
|
2012-12-10 19:58:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2014-05-06 01:56:44 +00:00
|
|
|
let x = S { x: box 1 };
|
2014-01-09 10:06:55 +00:00
|
|
|
println!("{}", x.foo());
|
2012-12-10 19:58:37 +00:00
|
|
|
}
|