You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0382]: use of moved value: `self.vec`
--> test2.rs:7:24
|
7 | self.inner_run(self.vec.clone())
| ---- ^^^^^^^^ value used here after move
| |
| value moved here
|
= note: move occurs because `self` has type `VecHolder`, which does not implement the `Copy` trait
But if run is like the following, the code compiles:
This doesn't really have to do with the borrow checker, in function calls the receiver is just evaluated before any arguments. This is intentional (it's basically an implication of "function arguments are evaluated left-to-right"), and can't be changed because unsafe code can rely on it.
The following code gets an error from compiler:
Error message is
But if
run
is like the following, the code compiles:The two versions are just equivalent to me. Is this a bug or a feature?
I found related discussion in rust internals and github. Not sure if any documentation is produced.
The text was updated successfully, but these errors were encountered: