]> git.lizzy.rs Git - rust.git/blob - tests/ui/use/use-after-move-self.rs
Don't resolve type var roots in point_at_expr_source_of_inferred_type
[rust.git] / tests / ui / use / use-after-move-self.rs
1 struct S {
2     x: Box<isize>,
3 }
4
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: 1.into() };
18     println!("{}", x.foo());
19 }