From 9e726b0461018abf6c9436e2dcd7b91cf1f15d97 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Wed, 11 Apr 2012 10:20:52 -0700 Subject: [PATCH] Add description of by-move mode. --- doc/tutorial.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/tutorial.md b/doc/tutorial.md index 5ce05b2b502..212de24beaf 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -1476,6 +1476,13 @@ fn make_person(+name: str, +address: str) -> person { } ~~~~ +Finally there is by-move style, written `-`. This indicates that the +function will take ownership of the argument, like with by-copy style, +but a copy must not be made. The caller is (statically) obliged to not +use the argument after the call; it is de-initialized as part of the +call. This is used to support ownership-passing in the presence of +non-copyable types. + # Generics ## Generic functions