Skip to content

Instantly share code, notes, and snippets.

@rubber-duck
Created June 21, 2013 23:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rubber-duck/5834958 to your computer and use it in GitHub Desktop.
Save rubber-duck/5834958 to your computer and use it in GitHub Desktop.
struct Foo {
bar: ~[int]
}
fn main() {
let mut foo = Foo { bar: ~[0i] };
foo.bar = append_one(foo.bar, 1);
}
test.rs:8:4: 8:7 error: use of partially moved value: `foo`
test.rs:8 foo.bar = append_one(foo.bar, 1);
^~~
test.rs:8:25: 8:32 note: `foo.bar` moved here because it has type `~[int]`, which is moved by default (use `copy` to override)
test.rs:8 foo.bar = append_one(foo.bar, 1);
^~~~~~~
error: aborting due to previous error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment