Skip to content

Commit 9876e6a

Browse files
committed
---
yaml --- r: 40810 b: refs/heads/dist-snap c: c7f7be8 h: refs/heads/master v: v3
1 parent 8570a51 commit 9876e6a

File tree

397 files changed

+5952
-5012
lines changed

Some content is hidden

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

397 files changed

+5952
-5012
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
99
refs/heads/incoming: e90142e536c150df0d9b4b2f11352152177509b5
10-
refs/heads/dist-snap: 1b9f740f2fe7d67d70ae5b49b741712706cccead
10+
refs/heads/dist-snap: c7f7be83f5f9c8ec86fbb753fbc301d63a9cd957
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/AUTHORS.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ Gonçalo Cabrita <[email protected]>
5454
Graham Fawcett <[email protected]>
5555
Grahame Bowland <[email protected]>
5656
Haitao Li <[email protected]>
57-
Huon Wilson <[email protected]>
5857
Ian D. Bollinger <[email protected]>
5958
Ivano Coppola <[email protected]>
6059
Jacob Harris Cryer Kragh <[email protected]>

branches/dist-snap/RELEASES.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Version 0.5 (December 2012)
22
---------------------------
33

4-
* ~800 changes, numerous bugfixes
4+
* ~700 changes, numerous bugfixes
55

66
* Syntax changes
77
* Removed `<-` move operator
@@ -13,7 +13,6 @@ Version 0.5 (December 2012)
1313
* `Eq` and `IterBytes` implementations can be automatically generated
1414
with `#[deriving_eq]` and `#[deriving_iter_bytes]` respectively
1515
* Removed the special crate language for `.rc` files
16-
* Function arguments may consist of any irrefutable pattern
1716

1817
* Semantic changes
1918
* `&` and `~` pointers may point to objects
@@ -25,15 +24,13 @@ Version 0.5 (December 2012)
2524
without writing `move` explicitly
2625
* `&T` may now be coerced to `*T`
2726
* Coercions happen in `let` statements as well as function calls
28-
* `use` statements now take crate-relative paths
2927

3028
* Improved support for language features
3129
* Trait inheritance is much more complete
30+
* Traits may declare default methods for the implementations to use
3231
* More support for explicit self arguments in methods - `self`, `&self`
3332
`@self`, and `~self` all generally work as expected
3433
* Static methods work in more situations
35-
* Experimental: Traits may declare default methods for the implementations
36-
to use
3734

3835
* Libraries
3936
* New condition handling system in `core::condition`

branches/dist-snap/doc/rust.md

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -847,25 +847,10 @@ fn main() {
847847

848848
Like items, `use` declarations are private to the containing module, by default.
849849
Also like items, a `use` declaration can be public, if qualified by the `pub` keyword.
850-
Such a `use` declaration serves to _re-export_ a name.
851850
A public `use` declaration can therefore be used to _redirect_ some public name to a different target definition,
852851
even a definition with a private canonical path, inside a different module.
853852
If a sequence of such redirections form a cycle or cannot be unambiguously resolved, they represent a compile-time error.
854853

855-
An example of re-exporting:
856-
~~~~
857-
mod quux {
858-
mod foo {
859-
pub fn bar() { }
860-
pub fn baz() { }
861-
}
862-
863-
pub use foo::*;
864-
}
865-
~~~~
866-
867-
In this example, the module `quux` re-exports all of the public names defined in `foo`.
868-
869854
### Functions
870855

871856
A _function item_ defines a sequence of [statements](#statements) and an optional final [expression](#expressions), along with a name and a set of parameters.
@@ -2719,18 +2704,18 @@ The special type `self` has a meaning within methods inside an
27192704
impl item. It refers to the type of the implicit `self` argument. For
27202705
example, in:
27212706

2722-
~~~~~~~~
2707+
~~~~~~~~{.xfail-test}
27232708
trait Printable {
2724-
fn make_string() -> ~str;
2709+
fn to_str() -> ~str;
27252710
}
27262711
27272712
impl ~str: Printable {
2728-
fn make_string() -> ~str { copy self }
2713+
fn to_str() -> ~str { copy self }
27292714
}
27302715
~~~~~~~~
27312716

27322717
`self` refers to the value of type `~str` that is the receiver for a
2733-
call to the method `make_string`.
2718+
call to the method `to_str`.
27342719

27352720
## Type kinds
27362721

@@ -2740,11 +2725,11 @@ The kinds are:
27402725
`Const`
27412726
: Types of this kind are deeply immutable;
27422727
they contain no mutable memory locations directly or indirectly via pointers.
2743-
`Owned`
2728+
`Send`
27442729
: Types of this kind can be safely sent between tasks.
27452730
This kind includes scalars, owning pointers, owned closures, and
2746-
structural types containing only other owned types. All `Owned` types are `Static`.
2747-
`Static`
2731+
structural types containing only other sendable types.
2732+
`Owned`
27482733
: Types of this kind do not contain any borrowed pointers;
27492734
this can be a useful guarantee for code that breaks borrowing assumptions using [`unsafe` operations](#unsafe-functions).
27502735
`Copy`
@@ -2833,10 +2818,10 @@ frame they are allocated within.
28332818
A task owns all memory it can *safely* reach through local variables,
28342819
as well as managed, owning and borrowed pointers.
28352820

2836-
When a task sends a value that has the `Owned` trait to another task,
2821+
When a task sends a value that has the `Send` trait to another task,
28372822
it loses ownership of the value sent and can no longer refer to it.
28382823
This is statically guaranteed by the combined use of "move semantics",
2839-
and the compiler-checked _meaning_ of the `Owned` trait:
2824+
and the compiler-checked _meaning_ of the `Send` trait:
28402825
it is only instantiated for (transitively) sendable kinds of data constructor and pointers,
28412826
never including managed or borrowed pointers.
28422827

@@ -2971,7 +2956,7 @@ These include:
29712956
- read-only and read-write shared variables with various safe mutual exclusion patterns
29722957
- simple locks and semaphores
29732958

2974-
When such facilities carry values, the values are restricted to the [`Owned` type-kind](#type-kinds).
2959+
When such facilities carry values, the values are restricted to the [`Send` type-kind](#type-kinds).
29752960
Restricting communication interfaces to this kind ensures that no borrowed or managed pointers move between tasks.
29762961
Thus access to an entire data structure can be mediated through its owning "root" value;
29772962
no further locking or copying is required to avoid data races within the substructure of such a value.

branches/dist-snap/doc/tutorial-tasks.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ come in a variety of forms, each one appropriate for a different use case. In
150150
what follows, we cover the most commonly used varieties.
151151

152152
The simplest way to create a pipe is to use the `pipes::stream`
153-
function to create a `(Port, Chan)` pair. In Rust parlance, a *channel*
153+
function to create a `(Chan, Port)` pair. In Rust parlance, a *channel*
154154
is a sending endpoint of a pipe, and a *port* is the receiving
155155
endpoint. Consider the following example of calculating two results
156156
concurrently:
@@ -159,7 +159,7 @@ concurrently:
159159
use task::spawn;
160160
use pipes::{stream, Port, Chan};
161161
162-
let (port, chan): (Port<int>, Chan<int>) = stream();
162+
let (chan, port): (Chan<int>, Port<int>) = stream();
163163
164164
do spawn |move chan| {
165165
let result = some_expensive_computation();
@@ -179,7 +179,7 @@ a tuple into its component parts).
179179

180180
~~~~
181181
# use pipes::{stream, Chan, Port};
182-
let (port, chan): (Port<int>, Chan<int>) = stream();
182+
let (chan, port): (Chan<int>, Port<int>) = stream();
183183
~~~~
184184

185185
The child task will use the channel to send data to the parent task,
@@ -191,7 +191,7 @@ spawns the child task.
191191
# use task::spawn;
192192
# use pipes::{stream, Port, Chan};
193193
# fn some_expensive_computation() -> int { 42 }
194-
# let (port, chan) = stream();
194+
# let (chan, port) = stream();
195195
do spawn |move chan| {
196196
let result = some_expensive_computation();
197197
chan.send(result);
@@ -211,7 +211,7 @@ port:
211211
~~~~
212212
# use pipes::{stream, Port, Chan};
213213
# fn some_other_expensive_computation() {}
214-
# let (port, chan) = stream::<int>();
214+
# let (chan, port) = stream::<int>();
215215
# chan.send(0);
216216
some_other_expensive_computation();
217217
let result = port.recv();
@@ -227,7 +227,7 @@ following program is ill-typed:
227227
# use task::{spawn};
228228
# use pipes::{stream, Port, Chan};
229229
# fn some_expensive_computation() -> int { 42 }
230-
let (port, chan) = stream();
230+
let (chan, port) = stream();
231231
232232
do spawn |move chan| {
233233
chan.send(some_expensive_computation());
@@ -247,7 +247,7 @@ Instead we can use a `SharedChan`, a type that allows a single
247247
# use task::spawn;
248248
use pipes::{stream, SharedChan};
249249
250-
let (port, chan) = stream();
250+
let (chan, port) = stream();
251251
let chan = SharedChan(move chan);
252252
253253
for uint::range(0, 3) |init_val| {
@@ -282,7 +282,7 @@ might look like the example below.
282282
283283
// Create a vector of ports, one for each child task
284284
let ports = do vec::from_fn(3) |init_val| {
285-
let (port, chan) = stream();
285+
let (chan, port) = stream();
286286
do spawn |move chan| {
287287
chan.send(some_expensive_computation(init_val));
288288
}
@@ -397,7 +397,7 @@ before returning. Hence:
397397
# use task::{spawn, try};
398398
# fn sleep_forever() { loop { task::yield() } }
399399
# do task::try {
400-
let (receiver, sender): (Port<int>, Chan<int>) = stream();
400+
let (sender, receiver): (Chan<int>, Port<int>) = stream();
401401
do spawn |move receiver| { // Bidirectionally linked
402402
// Wait for the supervised child task to exist.
403403
let message = receiver.recv();

branches/dist-snap/doc/tutorial.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1914,9 +1914,9 @@ types by the compiler, and may not be overridden:
19141914
`copy` operator. All types are copyable unless they have destructors or
19151915
contain types with destructors.
19161916

1917-
* `Owned` - Owned types. Types are owned unless they contain managed
1918-
boxes, managed closures, or borrowed pointers. Owned types may or
1919-
may not be copyable.
1917+
* `Send` - Sendable (owned) types. All types are sendable unless they
1918+
contain managed boxes, managed closures, or otherwise managed
1919+
types. Sendable types may or may not be copyable.
19201920

19211921
* `Const` - Constant (immutable) types. These are types that do not contain
19221922
mutable fields.
@@ -1949,7 +1949,7 @@ may call it.
19491949
## Declaring and implementing traits
19501950

19511951
A trait consists of a set of methods, without bodies, or may be empty,
1952-
as is the case with `Copy`, `Owned`, and `Const`. For example, we could
1952+
as is the case with `Copy`, `Send`, and `Const`. For example, we could
19531953
declare the trait `Printable` for things that can be printed to the
19541954
console, with a single method:
19551955

branches/dist-snap/mk/clean.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ clean-misc:
4949
$(Q)rm -Rf $(DOCS)
5050
$(Q)rm -Rf $(GENERATED)
5151
$(Q)rm -f tmp/*.log tmp/*.rc tmp/*.rs
52-
$(Q)rm -Rf rust-stage0-*.tar.bz2 $(PKG_NAME)-*.tar.gz dist
52+
$(Q)rm -Rf $(PKG_NAME)-*.tar.gz dist
5353
$(Q)rm -Rf $(foreach ext, \
5454
html aux cp fn ky log pdf pg toc tp vr cps, \
5555
$(wildcard doc/*.$(ext) \

branches/dist-snap/src/etc/vim/syntax/rust.vim

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
" Language: Rust
33
" Maintainer: Patrick Walton <[email protected]>
44
" Maintainer: Ben Blum <[email protected]>
5-
" Last Change: 2012 Jul 06
5+
" Last Change: 2012 Dec 14
66

77
if version < 600
88
syntax clear
@@ -11,16 +11,16 @@ elseif exists("b:current_syntax")
1111
endif
1212

1313
syn match rustAssert "\<assert\(\w\)*"
14-
syn keyword rustKeyword again as break
14+
syn keyword rustKeyword as break
1515
syn keyword rustKeyword const copy do drop else export extern fail
16-
syn keyword rustKeyword for if impl import in let log
17-
syn keyword rustKeyword loop match mod module move mut new of priv pure
16+
syn keyword rustKeyword for if impl let log
17+
syn keyword rustKeyword loop match mod move mut once priv pure
1818
syn match rustKeyword "\<pub\>"
19-
syn keyword rustKeyword ref return static to unchecked
19+
syn keyword rustKeyword ref return static
2020
syn match rustKeyword "\<unsafe\>" " Allows also matching unsafe::foo()
21-
syn keyword rustKeyword use while with
21+
syn keyword rustKeyword use while
2222
" FIXME: Scoped impl's name is also fallen in this category
23-
syn keyword rustKeyword mod trait class struct enum type nextgroup=rustIdentifier skipwhite
23+
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite
2424
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite
2525

2626
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained

branches/dist-snap/src/libcargo/cargo.rc

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,26 @@ extern mod std(vers = "0.5");
4242
extern mod rustc(vers = "0.5");
4343
extern mod syntax(vers = "0.5");
4444

45+
use core::*;
46+
4547
#[legacy_exports]
4648
mod pgp;
4749

48-
use rustc::metadata::filesearch::{get_cargo_root, get_cargo_root_nearest};
49-
use rustc::metadata::filesearch::{get_cargo_sysroot, libdir};
50-
51-
use core::*;
52-
53-
use core::dvec::DVec;
54-
use core::io::WriterUtil;
55-
use core::result::{Ok, Err};
56-
use core::send_map::linear::LinearMap;
57-
use std::getopts::{optflag, optopt, opt_present};
58-
use std::map::HashMap;
59-
use std::{map, json, tempfile, term, sort, getopts};
60-
use syntax::codemap::span;
50+
use syntax::{ast, codemap, parse, visit, attr};
6151
use syntax::diagnostic::span_handler;
52+
use codemap::span;
53+
use rustc::metadata::filesearch::{get_cargo_root, get_cargo_root_nearest,
54+
get_cargo_sysroot, libdir};
6255
use syntax::diagnostic;
63-
use syntax::{ast, codemap, parse, visit, attr};
56+
57+
use result::{Ok, Err};
58+
use io::WriterUtil;
59+
use send_map::linear::LinearMap;
60+
use std::{map, json, tempfile, term, sort, getopts};
61+
use map::HashMap;
62+
use to_str::to_str;
63+
use getopts::{optflag, optopt, opt_present};
64+
use dvec::DVec;
6465

6566
struct Package {
6667
name: ~str,

branches/dist-snap/src/libcore/at_vec.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub pure fn build_sized<A>(size: uint,
6161
builder: &fn(push: pure fn(v: A))) -> @[A] {
6262
let mut vec: @[const A] = @[];
6363
unsafe { raw::reserve(&mut vec, size); }
64-
builder(|+x| unsafe { raw::push(&mut vec, x) });
64+
builder(|+x| unsafe { raw::push(&mut vec, move x) });
6565
return unsafe { transmute(vec) };
6666
}
6767

@@ -178,10 +178,10 @@ pub mod raw {
178178
let repr: **VecRepr = ::cast::reinterpret_cast(&v);
179179
let fill = (**repr).unboxed.fill;
180180
if (**repr).unboxed.alloc > fill {
181-
push_fast(v, initval);
181+
push_fast(v, move initval);
182182
}
183183
else {
184-
push_slow(v, initval);
184+
push_slow(v, move initval);
185185
}
186186
}
187187

branches/dist-snap/src/libcore/cast.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,10 @@ pub mod tests {
130130

131131
#[test]
132132
pub fn test_transmute() {
133-
use managed::raw::BoxRepr;
134133
unsafe {
135-
let x = @100u8;
136-
let x: *BoxRepr = transmute(move x);
137-
assert (*x).data == 100;
134+
let x = @1;
135+
let x: *int = transmute(move x);
136+
assert *x == 1;
138137
let _x: @int = transmute(move x);
139138
}
140139
}

branches/dist-snap/src/libcore/char.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ pub pure fn escape_unicode(c: char) -> ~str {
149149
{ str::push_str(&mut out, ~"0"); }
150150
str::push_str(&mut out, s);
151151
}
152-
out
152+
move out
153153
}
154154

155155
/**

branches/dist-snap/src/libcore/cleanup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ pub unsafe fn annihilate() {
152152
assert (*box).header.prev == null();
153153

154154
debug!("freeing box: %x", box as uint);
155-
rt_free(transmute(box));
155+
rt_free(transmute(move box));
156156
}
157157
}
158158

0 commit comments

Comments
 (0)