Last active
August 29, 2015 13:58
-
-
Save tfogal/9984008 to your computer and use it in GitHub Desktop.
rust errors in english
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* cannot index a value of type `std::vec::Vec<T>` | |
Rust's vector type doesn't implement whatever-it-needs to be able to use the standard indexing operator ("[]") with it. Use .get(idx) or .get_mut(idx) instead. | |
* error: cannot move out of dereference of `&`-pointer | |
The thing rust is highlighting is used in a context where it must be 'moved'. "moved" seems to imply the same semantics as C++'s 'std::move'. | |
One fix is to make the receiver accept a &T of whatever T it wants, and fix the call site appropriately. A better fix is to just rewrite the code so that the receiver isn't used at all. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment