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
<anon>:4:14: 4:15 error: use of moved value: `v`
<anon>:4 drop(v);
^
<anon>:4:14: 4:15 note: `v` moved here because it has type `collections::vec::Vec<i32>`, which is non-copyable
<anon>:4 drop(v);
^
In this simple example, it is pretty easy to notice that the error happens in the next iteration. However, usually the code is more complicated than this and the error is very confusing (see this reddit thread). Maybe we could add something like move happens in the next iteration of the loop.
The text was updated successfully, but these errors were encountered:
I dont know, I feel like the error message makes perfect sense. This is just a case of learning the language and not knowing all (or a good amount of) error cases, in my opinion.
If we had error messages for everything like this, then compiler output would be inundated with crap that no one reads anyways.
The code:
The error message:
In this simple example, it is pretty easy to notice that the error happens in the next iteration. However, usually the code is more complicated than this and the error is very confusing (see this reddit thread). Maybe we could add something like
move happens in the next iteration of the loop
.The text was updated successfully, but these errors were encountered: