Skip to content

Instantly share code, notes, and snippets.

@vijairaj
Last active December 13, 2018 17:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vijairaj/ec18d2dd3854c115b18e039c8a97f62d to your computer and use it in GitHub Desktop.
Save vijairaj/ec18d2dd3854c115b18e039c8a97f62d to your computer and use it in GitHub Desktop.
Rust compiler errors
|
13 | let x, y = 21, 22;
| -^-- help: try adding parentheses: `(x, y)`
----
|
24 | println!("val {:?} {:?} {:?}", pt, pt2, pt3);
| ^^ did you mean `pt1`?
----
error[E0499]: cannot borrow `vec` as mutable more than once at a time
--> src/main.rs:5:9
|
4 | for n in &mut vec {
| --------
| |
| first mutable borrow occurs here
| first borrow used here, in later iteration of loop
5 | vec.push(*n * 10);
| ^^^ second mutable borrow occurs here
----
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment