]> git.lizzy.rs Git - rust.git/blob - src/test/ui/use/use-after-move-self.stderr
Rollup merge of #80935 - pierwill:rustc_middle-levelandsource, r=petrochenkov
[rust.git] / src / test / ui / use / use-after-move-self.stderr
1 error[E0382]: use of moved value: `self`
2   --> $DIR/use-after-move-self.rs:10:16
3    |
4 LL |     pub fn foo(self) -> isize {
5    |                ---- move occurs because `self` has type `S`, which does not implement the `Copy` trait
6 LL |         self.bar();
7    |              ----- `self` moved due to this method call
8 LL |         return *self.x;
9    |                ^^^^^^^ value used here after move
10    |
11 note: this function takes ownership of the receiver `self`, which moves `self`
12   --> $DIR/use-after-move-self.rs:13:16
13    |
14 LL |     pub fn bar(self) {}
15    |                ^^^^
16
17 error: aborting due to previous error
18
19 For more information about this error, try `rustc --explain E0382`.