Skip to content

Commit 7317c27

Browse files
committed
---
yaml --- r: 38779 b: refs/heads/incoming c: d4432a7 h: refs/heads/master i: 38777: 0304a54 38775: 8758126 v: v3
1 parent a8373c6 commit 7317c27

File tree

180 files changed

+2653
-2771
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+2653
-2771
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
9-
refs/heads/incoming: b2d5acd6bcf34da3c7a16e554f9249c4cb1cc846
9+
refs/heads/incoming: d4432a797450594ff78457fe3e516bb0aeaedfe0
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,3 @@ tmp.*.rs
8080
config.stamp
8181
.DS_Store
8282
src/etc/dl
83-
.settings/

branches/incoming/AUTHORS.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ Tim Chevalier <[email protected]>
108108
109109
Tomoki Aonuma <[email protected]>
110110
Tycho Sci <[email protected]>
111-
Viktor Dahl <[email protected]>
112111
Vincent Belliard <[email protected]>
113112
Wade Mealing <[email protected]>
114113
Yasuhiro Fujii <[email protected]>

branches/incoming/doc/rust.md

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,7 @@ declaring a function-local item.
13881388

13891389
~~~~~~~~{.ebnf .gram}
13901390
let_decl : "let" pat [':' type ] ? [ init ] ? ';' ;
1391-
init : [ '=' ] expr ;
1391+
init : [ '=' | '<-' ] expr ;
13921392
~~~~~~~~
13931393

13941394
A _slot declaration_ introduces a new set of slots, given by a pattern.
@@ -1728,6 +1728,38 @@ 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+
17311763
#### Swap expressions
17321764

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

1763-
Evaluating an assignment expression copies the expression on the right-hand side and stores it in the location on the left-hand side.
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:
17641799

17651800
~~~~
17661801
# let mut x = 0;
17671802
# let y = 0;
17681803
17691804
x = y;
1805+
x <- copy y;
17701806
~~~~
17711807

1808+
The former is just more terse and familiar.
1809+
17721810
#### Compound assignment expressions
17731811

17741812
The `+`, `-`, `*`, `/`, `%`, `&`, `|`, `^`, `<<`, and `>>`
@@ -1795,7 +1833,7 @@ as
17951833
== !=
17961834
&&
17971835
||
1798-
= <->
1836+
= <- <->
17991837
~~~~
18001838

18011839
Operators at the same precedence level are evaluated left-to-right.
@@ -2507,7 +2545,7 @@ let a: List<int> = Cons(7, @Cons(13, @Nil));
25072545

25082546
> **Note:** Records are not nominal types, thus do not directly support recursion, visibility control,
25092547
> out-of-order field initialization, or coherent trait implementation.
2510-
> Records are therefore deprecated and will be removed in future versions of Rust.
2548+
> Records are therefore deprecared and will be removed in future versions of Rust.
25112549
> [Structure types](#structure-types) should be used instead.
25122550
25132551
The record type-constructor forms a new heterogeneous product of values.

branches/incoming/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 = move v; // Replace x.f
432+
x.f <- v; // Replace x.f
433433
...
434434
# return 0;
435435
}

branches/incoming/doc/tutorial.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,6 +1205,11 @@ to other tasks. The sending task will give up ownership of the box,
12051205
and won't be able to access it afterwards. The receiving task will
12061206
become the sole owner of the box.
12071207

1208+
> ***Note:*** This discussion of copying vs. moving does not account
1209+
> for the "last use" rules that automatically promote copy operations
1210+
> to moves. We plan to remove last use from the language in
1211+
> favor of explicit moves.
1212+
12081213
## Borrowed pointers
12091214

12101215
Rust borrowed pointers are a general purpose reference/pointer type,

branches/incoming/mk/rt.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ RUNTIME_CS_$(1) := \
7272
rt/rust_shape.cpp \
7373
rt/rust_abi.cpp \
7474
rt/rust_debug.cpp \
75+
rt/rust_box_annihilator.cpp \
7576
rt/memory_region.cpp \
7677
rt/boxed_region.cpp \
7778
rt/arch/$$(HOST_$(1))/context.cpp \

branches/incoming/src/cargo/cargo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1491,7 +1491,7 @@ fn print_pkg(s: @Source, p: &Package) {
14911491
fn print_source(s: @Source) {
14921492
info(s.name + ~" (" + s.url + ~")");
14931493

1494-
let pks = sort::merge_sort(sys::shape_lt, s.packages.get());
1494+
let pks = sort::merge_sort(s.packages.get(), sys::shape_lt);
14951495
let l = vec::len(pks);
14961496

14971497
print(io::with_str_writer(|writer| {

branches/incoming/src/fuzzer/ivec_fuzz.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
Idea: provide functions for 'exhaustive' and 'random' modification of vecs.
44
5-
two functions, "return all edits" and "return a random edit" = move-
5+
two functions, "return all edits" and "return a random edit" <--
66
leaning toward this model or two functions, "return the number of
77
possible edits" and "return edit #n"
88

branches/incoming/src/libcore/at_vec.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -136,23 +136,12 @@ pub pure fn from_elem<T: Copy>(n_elts: uint, t: T) -> @[T] {
136136
#[cfg(notest)]
137137
pub mod traits {
138138
#[legacy_exports];
139-
140-
#[cfg(stage0)]
141139
pub impl<T: Copy> @[T] : Add<&[const T],@[T]> {
142140
#[inline(always)]
143141
pure fn add(rhs: & &[const T]) -> @[T] {
144142
append(self, (*rhs))
145143
}
146144
}
147-
148-
#[cfg(stage1)]
149-
#[cfg(stage2)]
150-
pub impl<T: Copy> @[T] : Add<&[const T],@[T]> {
151-
#[inline(always)]
152-
pure fn add(rhs: & &self/[const T]) -> @[T] {
153-
append(self, (*rhs))
154-
}
155-
}
156145
}
157146

158147
#[cfg(test)]

0 commit comments

Comments
 (0)