Created
June 21, 2013 23:00
-
-
Save rubber-duck/5834958 to your computer and use it in GitHub Desktop.
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
struct Foo { | |
bar: ~[int] | |
} | |
fn main() { | |
let mut foo = Foo { bar: ~[0i] }; | |
foo.bar = append_one(foo.bar, 1); | |
} |
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
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