[rust-dev] '-' as prefix to a function argument?
catamorphism at gmail.com
Wed Apr 11 10:19:17 PDT 2012
On Wed, Apr 11, 2012 at 4:26 AM, Peter Ronnquist
<peter.ronnquist at gmail.com> wrote:
> I have a question regarding '-' as a prefix to a function argument as
> used in the task-perf-word-count.rs test file:
Hi, Peter --
The '-' prefix means that an argument is passed by move, meaning that
when control passes to the callee, it becomes deinitialized at the
call site. (Obviously, this means the caller has to pass an l-value.)
This does not seem to be documented, and should be.
Tim Chevalier * http://catamorphism.org/ * Often in error, never in doubt
"Debate is useless when one participant denies the full dignity of the
other." -- Eric Berndt
More information about the Rust-dev