]> git.lizzy.rs Git - rust.git/blob - src/test/ui/use/use-after-move-self.rs
Merge commit 'cd4810de42c57b64b74dae09c530a4c3a41f87b9' into libgccjit-codegen
[rust.git] / src / test / ui / use / use-after-move-self.rs
1 #![feature(box_syntax)]
2
3 struct S {
4     x: Box<isize>,
5 }
6
7 impl S {
8     pub fn foo(self) -> isize {
9         self.bar();
10         return *self.x;  //~ ERROR use of moved value: `self`
11     }
12
13     pub fn bar(self) {}
14 }
15
16 fn main() {
17     let x = S { x: box 1 };
18     println!("{}", x.foo());
19 }