2019-04-22 07:40:08 +00:00
|
|
|
error[E0382]: use of moved value: `self`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/use-after-move-self.rs:10:16
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | pub fn foo(self) -> isize {
|
|
|
|
| ---- move occurs because `self` has type `S`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | self.bar();
|
2020-06-11 17:48:46 +00:00
|
|
|
| ----- `self` moved due to this method call
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | return *self.x;
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^^^^^ value used here after move
|
2020-06-11 17:48:46 +00:00
|
|
|
|
|
2022-12-12 12:07:09 +00:00
|
|
|
note: `S::bar` takes ownership of the receiver `self`, which moves `self`
|
2020-06-11 17:48:46 +00:00
|
|
|
--> $DIR/use-after-move-self.rs:13:16
|
|
|
|
|
|
|
|
|
LL | pub fn bar(self) {}
|
|
|
|
| ^^^^
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0382`.
|