Skip to content

Commit fb940a0

Browse files
committed
---
yaml --- r: 36075 b: refs/heads/try2 c: 804c608 h: refs/heads/master i: 36073: 8cde1fc 36071: e9669fe v: v3
1 parent 660eeb4 commit fb940a0

File tree

3 files changed

+3
-41
lines changed

3 files changed

+3
-41
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 3bf0a9b0945f297d1aea330b6afcf98052e6de1e
8+
refs/heads/try2: 804c608f0166c90dcf04e5d00b48cc4d5c9e9d3c
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try2/doc/rust.md

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,38 +1728,6 @@ fn avg(v: &[float]) -> float {
17281728
}
17291729
~~~~
17301730

1731-
1732-
#### Binary move expressions
1733-
1734-
A _binary move expression_ consists of an [lvalue](#lvalues-rvalues-and-temporaries) followed by a left-pointing
1735-
arrow (`<-`) and an [rvalue](#lvalues-rvalues-and-temporaries) expression.
1736-
1737-
Evaluating a move expression causes, as a side effect,
1738-
the rvalue to be *moved* into the lvalue.
1739-
If the rvalue was itself an lvalue, it must be a local variable,
1740-
as it will be de-initialized in the process.
1741-
1742-
Evaluating a move expression does not change reference counts,
1743-
nor does it cause a deep copy of any owned structure pointed to by the moved rvalue.
1744-
Instead, the move expression represents an indivisible *transfer of ownership*
1745-
from the right-hand-side to the left-hand-side of the expression.
1746-
No allocation or destruction is entailed.
1747-
1748-
An example of three different move expressions:
1749-
1750-
~~~~~~~~
1751-
# let mut x = &[mut 0];
1752-
# let a = &[mut 0];
1753-
# let b = 0;
1754-
# let y = {mut z: 0};
1755-
# let c = 0;
1756-
# let i = 0;
1757-
1758-
x <- a;
1759-
x[i] <- b;
1760-
y.z <- c;
1761-
~~~~~~~~
1762-
17631731
#### Swap expressions
17641732

17651733
A _swap expression_ consists of an [lvalue](#lvalues-rvalues-and-temporaries) followed by a bi-directional arrow (`<->`) and another [lvalue](#lvalues-rvalues-and-temporaries).
@@ -1792,21 +1760,15 @@ y.z <-> b.c;
17921760
An _assignment expression_ consists of an [lvalue](#lvalues-rvalues-and-temporaries) expression followed by an
17931761
equals sign (`=`) and an [rvalue](#lvalues-rvalues-and-temporaries) expression.
17941762

1795-
Evaluating an assignment expression is equivalent to evaluating a [binary move
1796-
expression](#binary-move-expressions) applied to a [unary copy
1797-
expression](#unary-copy-expressions). For example, the following two
1798-
expressions have the same effect:
1763+
Evaluating an assignment expression copies the expression on the right-hand side and stores it in the location on the left-hand side.
17991764

18001765
~~~~
18011766
# let mut x = 0;
18021767
# let y = 0;
18031768
18041769
x = y;
1805-
x <- copy y;
18061770
~~~~
18071771

1808-
The former is just more terse and familiar.
1809-
18101772
#### Compound assignment expressions
18111773

18121774
The `+`, `-`, `*`, `/`, `%`, `&`, `|`, `^`, `<<`, and `>>`

branches/try2/doc/tutorial-borrowed-ptr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ fn example5c(x: @S) -> int {
429429
let y = &v.g;
430430
...
431431
}
432-
x.f <- v; // Replace x.f
432+
x.f = move v; // Replace x.f
433433
...
434434
# return 0;
435435
}

0 commit comments

Comments
 (0)