Skip to content

Commit 2114adc

Browse files
author
Cameron Zwarich
committed
---
yaml --- r: 120821 b: refs/heads/dist-snap c: 3bc76d2 h: refs/heads/master i: 120819: b970bb0 v: v3
1 parent 34a5808 commit 2114adc

File tree

274 files changed

+2681
-996
lines changed

Some content is hidden

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

274 files changed

+2681
-996
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 1813e5aa1a03b0596b8de7abd1af31edf5d6098f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: bcf3464827e7caebbbdb2404838fbb588cf304f0
9+
refs/heads/dist-snap: 3bc76d27ae8fd02667a337825127266c8f62c6a9
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/mk/crates.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
TARGET_CRATES := libc std green rustuv native flate arena glob term semver \
5353
uuid serialize sync getopts collections num test time rand \
54-
url log regex graphviz core rlibc alloc debug
54+
workcache url log regex graphviz core rlibc alloc debug
5555
HOST_CRATES := syntax rustc rustdoc fourcc hexfloat regex_macros fmt_macros
5656
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5757
TOOLS := compiletest rustdoc rustc
@@ -88,6 +88,7 @@ DEPS_test := std collections getopts serialize term time regex
8888
DEPS_time := std serialize sync
8989
DEPS_rand := core
9090
DEPS_url := std collections
91+
DEPS_workcache := std serialize collections log
9192
DEPS_log := std sync
9293
DEPS_regex := std collections
9394
DEPS_regex_macros = syntax std regex

branches/dist-snap/src/compiletest/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::from_str::FromStr;
1212
use std::fmt;
1313
use regex::Regex;
1414

15-
#[deriving(Clone, PartialEq)]
15+
#[deriving(Clone, Eq)]
1616
pub enum Mode {
1717
CompileFail,
1818
RunFail,

branches/dist-snap/src/doc/complement-cheatsheet.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ To return a Borrowed String Slice (&str) use the str helper function
5353
~~~
5454
use std::str;
5555
56-
let bytes = &[104u8,105u8];
57-
let x: &str = str::from_utf8(bytes).unwrap();
56+
let bytes = ~[104u8,105u8];
57+
let x: Option<&str> = str::from_utf8(bytes);
58+
let y: &str = x.unwrap();
5859
~~~
5960

6061
To return an Owned String use the str helper function
@@ -135,7 +136,7 @@ let index: Option<uint> = str.find_str("rand");
135136
The [`Container`](../std/container/trait.Container.html) trait provides the `len` method.
136137

137138
~~~
138-
let u: Vec<u32> = vec![0, 1, 2];
139+
let u: ~[u32] = ~[0, 1, 2];
139140
let v: &[u32] = &[0, 1, 2, 3];
140141
let w: [u32, .. 5] = [0, 1, 2, 3, 4];
141142
@@ -147,7 +148,7 @@ println!("u: {}, v: {}, w: {}", u.len(), v.len(), w.len()); // 3, 4, 5
147148
Use the [`iter`](../std/vec/trait.ImmutableVector.html#tymethod.iter) method.
148149

149150
~~~
150-
let values: Vec<int> = vec![1, 2, 3, 4, 5];
151+
let values: ~[int] = ~[1, 2, 3, 4, 5];
151152
for value in values.iter() { // value: &int
152153
println!("{}", *value);
153154
}

branches/dist-snap/src/doc/guide-ffi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
# Introduction
44

5-
This guide will use the [snappy](https://github.com/google/snappy)
5+
This guide will use the [snappy](https://code.google.com/p/snappy/)
66
compression/decompression library as an introduction to writing bindings for
77
foreign code. Rust is currently unable to call directly into a C++ library, but
88
snappy includes a C interface (documented in
9-
[`snappy-c.h`](https://github.com/google/snappy/blob/master/snappy-c.h)).
9+
[`snappy-c.h`](https://code.google.com/p/snappy/source/browse/trunk/snappy-c.h)).
1010

1111
The following is a minimal example of calling a foreign function which will
1212
compile if snappy is installed:

branches/dist-snap/src/doc/guide-macros.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ To take as an argument a fragment of Rust code, write `$` followed by a name
8585
`foo`.)
8686
* `expr` (an expression. Examples: `2 + 2`; `if true then { 1 } else { 2 }`;
8787
`f(42)`.)
88-
* `ty` (a type. Examples: `int`, `Vec<(char, String)>`, `&T`.)
88+
* `ty` (a type. Examples: `int`, `~[(char, String)]`, `&T`.)
8989
* `pat` (a pattern, usually appearing in a `match` or on the left-hand side of
9090
a declaration. Examples: `Some(t)`; `(17, 'a')`; `_`.)
9191
* `block` (a sequence of actions. Example: `{ log(error, "hi"); return 12; }`)

branches/dist-snap/src/doc/intro.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,14 @@ Typically, tasks do not share memory but instead communicate amongst each other
198198

199199
```
200200
fn main() {
201-
let numbers = vec![1,2,3];
201+
let numbers = ~[1,2,3];
202202
203203
let (tx, rx) = channel();
204204
tx.send(numbers);
205205
206206
spawn(proc() {
207207
let numbers = rx.recv();
208-
println!("{}", *numbers.get(0));
208+
println!("{}", numbers[0]);
209209
})
210210
}
211211
```
@@ -237,26 +237,26 @@ try to modify the previous example to continue using the variable `numbers`:
237237

238238
```ignore
239239
fn main() {
240-
let numbers = vec![1,2,3];
240+
let numbers = ~[1,2,3];
241241
242242
let (tx, rx) = channel();
243243
tx.send(numbers);
244244
245245
spawn(proc() {
246246
let numbers = rx.recv();
247-
println!("{}", numbers.get(0));
247+
println!("{}", numbers[0]);
248248
});
249249
250250
// Try to print a number from the original task
251-
println!("{}", *numbers.get(0));
251+
println!("{}", numbers[0]);
252252
}
253253
```
254254

255255
This will result an error indicating that the value is no longer in scope:
256256

257257
```notrust
258258
concurrency.rs:12:20: 12:27 error: use of moved value: 'numbers'
259-
concurrency.rs:12 println!("{}", numbers.get(0));
259+
concurrency.rs:12 println!("{}", numbers[0]);
260260
^~~~~~~
261261
```
262262

@@ -267,7 +267,7 @@ Let's see an example that uses the `clone` method to create copies of the data:
267267

268268
```
269269
fn main() {
270-
let numbers = vec![1,2,3];
270+
let numbers = ~[1,2,3];
271271
272272
for num in range(0, 3) {
273273
let (tx, rx) = channel();
@@ -276,7 +276,7 @@ fn main() {
276276
277277
spawn(proc() {
278278
let numbers = rx.recv();
279-
println!("{:d}", *numbers.get(num as uint));
279+
println!("{:d}", numbers[num as uint]);
280280
})
281281
}
282282
}
@@ -301,7 +301,7 @@ extern crate sync;
301301
use sync::Arc;
302302
303303
fn main() {
304-
let numbers = vec![1,2,3];
304+
let numbers = ~[1,2,3];
305305
let numbers = Arc::new(numbers);
306306
307307
for num in range(0, 3) {
@@ -310,7 +310,7 @@ fn main() {
310310
311311
spawn(proc() {
312312
let numbers = rx.recv();
313-
println!("{:d}", *numbers.get(num as uint));
313+
println!("{:d}", numbers[num as uint]);
314314
})
315315
}
316316
}
@@ -348,7 +348,7 @@ extern crate sync;
348348
use sync::{Arc, Mutex};
349349
350350
fn main() {
351-
let numbers = vec![1,2,3];
351+
let numbers = ~[1,2,3];
352352
let numbers_lock = Arc::new(Mutex::new(numbers));
353353
354354
for num in range(0, 3) {
@@ -360,13 +360,9 @@ fn main() {
360360
361361
// Take the lock, along with exclusive access to the underlying array
362362
let mut numbers = numbers_lock.lock();
363+
numbers[num as uint] += 1;
363364
364-
// This is ugly for now, but will be replaced by
365-
// `numbers[num as uint] += 1` in the near future.
366-
// See: https://github.com/mozilla/rust/issues/6515
367-
*numbers.get_mut(num as uint) = *numbers.get_mut(num as uint) + 1;
368-
369-
println!("{}", *numbers.get(num as uint));
365+
println!("{}", numbers[num as uint]);
370366
371367
// When `numbers` goes out of scope the lock is dropped
372368
})

branches/dist-snap/src/doc/rust.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -886,8 +886,8 @@ fn main() {
886886
// Equivalent to 'std::iter::range_step(0, 10, 2);'
887887
range_step(0, 10, 2);
888888
889-
// Equivalent to 'foo(vec![std::option::Some(1.0), std::option::None]);'
890-
foo(vec![Some(1.0), None]);
889+
// Equivalent to 'foo(~[std::option::Some(1.0), std::option::None]);'
890+
foo(~[Some(1.0), None]);
891891
}
892892
~~~~
893893

@@ -995,8 +995,8 @@ the function name.
995995
fn iter<T>(seq: &[T], f: |T|) {
996996
for elt in seq.iter() { f(elt); }
997997
}
998-
fn map<T, U>(seq: &[T], f: |T| -> U) -> Vec<U> {
999-
let mut acc = vec![];
998+
fn map<T, U>(seq: &[T], f: |T| -> U) -> ~[U] {
999+
let mut acc = ~[];
10001000
for elt in seq.iter() { acc.push(f(elt)); }
10011001
acc
10021002
}
@@ -1159,19 +1159,19 @@ except that they have the `extern` modifier.
11591159

11601160
~~~~
11611161
// Declares an extern fn, the ABI defaults to "C"
1162-
extern fn new_int() -> int { 0 }
1162+
extern fn new_vec() -> ~[int] { ~[] }
11631163
11641164
// Declares an extern fn with "stdcall" ABI
1165-
extern "stdcall" fn new_int_stdcall() -> int { 0 }
1165+
extern "stdcall" fn new_vec_stdcall() -> ~[int] { ~[] }
11661166
~~~~
11671167

11681168
Unlike normal functions, extern fns have an `extern "ABI" fn()`.
11691169
This is the same type as the functions declared in an extern
11701170
block.
11711171

11721172
~~~~
1173-
# extern fn new_int() -> int { 0 }
1174-
let fptr: extern "C" fn() -> int = new_int;
1173+
# extern fn new_vec() -> ~[int] { ~[] }
1174+
let fptr: extern "C" fn() -> ~[int] = new_vec;
11751175
~~~~
11761176

11771177
Extern functions may be called directly from Rust code as Rust uses large,
@@ -1436,7 +1436,7 @@ trait Circle : Shape { fn radius() -> f64; }
14361436
~~~~
14371437

14381438
the syntax `Circle : Shape` means that types that implement `Circle` must also have an implementation for `Shape`.
1439-
Multiple supertraits are separated by `+`, `trait Circle : Shape + PartialEq { }`.
1439+
Multiple supertraits are separated by `+`, `trait Circle : Shape + Eq { }`.
14401440
In an implementation of `Circle` for a given type `T`, methods can refer to `Shape` methods,
14411441
since the typechecker checks that any type with an implementation of `Circle` also has an implementation of `Shape`.
14421442

@@ -1509,7 +1509,7 @@ Implementation parameters are written after the `impl` keyword.
15091509

15101510
~~~~
15111511
# trait Seq<T> { }
1512-
impl<T> Seq<T> for Vec<T> {
1512+
impl<T> Seq<T> for ~[T] {
15131513
/* ... */
15141514
}
15151515
impl Seq<bool> for u32 {
@@ -2159,23 +2159,23 @@ There are three different types of inline attributes:
21592159

21602160
The `deriving` attribute allows certain traits to be automatically
21612161
implemented for data structures. For example, the following will
2162-
create an `impl` for the `PartialEq` and `Clone` traits for `Foo`, the type
2163-
parameter `T` will be given the `PartialEq` or `Clone` constraints for the
2162+
create an `impl` for the `Eq` and `Clone` traits for `Foo`, the type
2163+
parameter `T` will be given the `Eq` or `Clone` constraints for the
21642164
appropriate `impl`:
21652165

21662166
~~~~
2167-
#[deriving(PartialEq, Clone)]
2167+
#[deriving(Eq, Clone)]
21682168
struct Foo<T> {
21692169
a: int,
21702170
b: T
21712171
}
21722172
~~~~
21732173

2174-
The generated `impl` for `PartialEq` is equivalent to
2174+
The generated `impl` for `Eq` is equivalent to
21752175

21762176
~~~~
21772177
# struct Foo<T> { a: int, b: T }
2178-
impl<T: PartialEq> PartialEq for Foo<T> {
2178+
impl<T: Eq> Eq for Foo<T> {
21792179
fn eq(&self, other: &Foo<T>) -> bool {
21802180
self.a == other.a && self.b == other.b
21812181
}
@@ -2188,7 +2188,7 @@ impl<T: PartialEq> PartialEq for Foo<T> {
21882188

21892189
Supported traits for `deriving` are:
21902190

2191-
* Comparison traits: `PartialEq`, `TotalEq`, `PartialOrd`, `TotalOrd`.
2191+
* Comparison traits: `Eq`, `TotalEq`, `Ord`, `TotalOrd`.
21922192
* Serialization: `Encodable`, `Decodable`. These require `serialize`.
21932193
* `Clone`, to create `T` from `&T` via a copy.
21942194
* `Hash`, to iterate over the bytes in a data type.
@@ -2734,22 +2734,22 @@ The default meaning of the operators on standard types is given here.
27342734

27352735
* `==`
27362736
: Equal to.
2737-
Calls the `eq` method on the `std::cmp::PartialEq` trait.
2737+
Calls the `eq` method on the `std::cmp::Eq` trait.
27382738
* `!=`
27392739
: Unequal to.
2740-
Calls the `ne` method on the `std::cmp::PartialEq` trait.
2740+
Calls the `ne` method on the `std::cmp::Eq` trait.
27412741
* `<`
27422742
: Less than.
2743-
Calls the `lt` method on the `std::cmp::PartialOrd` trait.
2743+
Calls the `lt` method on the `std::cmp::Ord` trait.
27442744
* `>`
27452745
: Greater than.
2746-
Calls the `gt` method on the `std::cmp::PartialOrd` trait.
2746+
Calls the `gt` method on the `std::cmp::Ord` trait.
27472747
* `<=`
27482748
: Less than or equal.
2749-
Calls the `le` method on the `std::cmp::PartialOrd` trait.
2749+
Calls the `le` method on the `std::cmp::Ord` trait.
27502750
* `>=`
27512751
: Greater than or equal.
2752-
Calls the `ge` method on the `std::cmp::PartialOrd` trait.
2752+
Calls the `ge` method on the `std::cmp::Ord` trait.
27532753

27542754
#### Type cast expressions
27552755

@@ -3347,7 +3347,7 @@ Such a definite-sized vector type is a first-class type, since its size is known
33473347
A vector without such a size is said to be of _indefinite_ size,
33483348
and is therefore not a _first-class_ type.
33493349
An indefinite-size vector can only be instantiated through a pointer type,
3350-
such as `&[T]` or `Vec<T>`.
3350+
such as `&[T]` or `~[T]`.
33513351
The kind of a vector type depends on the kind of its element type,
33523352
as with other simple structural types.
33533353

0 commit comments

Comments
 (0)