You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ rusti (git)-[master] -
WARNING: The Rust REPL is experimental and may be
unstable. If you encounter problems, please use the
compiler instead. Type :help for help.
rusti> let v = ~[1,2,3];
rusti> v
<anon>:43:36: 43:37 error: use of moved value: `v`
<anon>:43 let local: ~[int] = v;
^
<anon>:41:0: 41:1 note: `v` moved here because it has type `~[int]`, which is moved by default (use `copy` to override)
<anon>:41 v
^
error: aborting due to previous error
rust: task failed at 'explicit failure', /home/nksm/pkg/rust/src/rust/src/libsyntax/diagnostic.rs:95
I was thinking about this awhile back. I think that the best way to go about doing this would be to just don't re-serialize moved variables. Basically after the user-input code is executed, detect if any of the local bound variables were moved, and don't reserialize them.
The bad part is that you can move out of a variable and then use it in a later statement, but this is purely a debugging repl so I don't think that it's too bad.
Activity
gifnksm commentedon Jul 10, 2013
workaround for this issue.
alexcrichton commentedon Aug 27, 2013
I was thinking about this awhile back. I think that the best way to go about doing this would be to just don't re-serialize moved variables. Basically after the user-input code is executed, detect if any of the local bound variables were moved, and don't reserialize them.
The bad part is that you can move out of a variable and then use it in a later statement, but this is purely a debugging repl so I don't think that it's too bad.
auto merge of #9897 : thestinger/rust/rusti, r=alexcrichton
Auto merge of rust-lang#7692 - workingjubilee:float-cmp-not-wrong, r=…
Merge rust-lang#10546