Skip to content

Instantly share code, notes, and snippets.

@jviereck
Created March 31, 2015 08:47
Show Gist options
  • Save jviereck/039332a849af511824eb to your computer and use it in GitHub Desktop.
Save jviereck/039332a849af511824eb to your computer and use it in GitHub Desktop.
➜ move git:(master) ✗ rustc new_line_error.rs
new_line_error.rs:23:22: 23:26 error: use of moved value: `v.id`
new_line_error.rs:23 println!("{:?}", v.id);
^~~~
note: in expansion of format_args!
<std macros>:2:43: 2:76 note: expansion site
<std macros>:1:1: 2:78 note: in expansion of println!
new_line_error.rs:23:5: 23:28 note: expansion site
new_line_error.rs:22:9: 22:10 note: `v` moved here because it has type `&mut NonCopyableStruct`, which is moved by default
new_line_error.rs:22 let w = v;
^
new_line_error.rs:22:10: 22:10 help: use `ref` to override
new_line_error.rs:39:18: 39:21 error: cannot borrow immutable local variable `val` as mutable <<<=== EXPECTED NEW LINE!
new_line_error.rs:39 let v = &mut val;
^~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment