Skip to content

Commit 9e726b0

Browse files
committed
Add description of by-move mode.
1 parent fd26743 commit 9e726b0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/tutorial.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,13 @@ fn make_person(+name: str, +address: str) -> person {
14761476
}
14771477
~~~~
14781478

1479+
Finally there is by-move style, written `-`. This indicates that the
1480+
function will take ownership of the argument, like with by-copy style,
1481+
but a copy must not be made. The caller is (statically) obliged to not
1482+
use the argument after the call; it is de-initialized as part of the
1483+
call. This is used to support ownership-passing in the presence of
1484+
non-copyable types.
1485+
14791486
# Generics
14801487

14811488
## Generic functions

0 commit comments

Comments
 (0)