Skip to content

Commit 1a9f455

Browse files
committed
---
yaml --- r: 152252 b: refs/heads/try2 c: 96cc48f h: refs/heads/master v: v3
1 parent 62798fb commit 1a9f455

File tree

196 files changed

+3173
-3422
lines changed

Some content is hidden

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

196 files changed

+3173
-3422
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: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: ef9bf3a4ee61f7513356c3c9911cd38445e22de6
8+
refs/heads/try2: 96cc48fba28a32f0dd46b0fe38e04e6aff74456f
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/crates.mk

Lines changed: 3 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
@@ -101,6 +102,7 @@ TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs
101102
TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
102103

103104
ONLY_RLIB_core := 1
105+
ONLY_RLIB_libc := 1
104106
ONLY_RLIB_rlibc := 1
105107
ONLY_RLIB_alloc := 1
106108
ONLY_RLIB_rand := 1

branches/try2/src/README.md

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,26 @@ Source layout:
55
| Path | Description |
66
| ------------------- | --------------------------------------------------------- |
77
| `librustc/` | The self-hosted compiler |
8-
| `liballoc/` | Rust's core allocation library |
9-
| `libcore/` | The Rust core library |
10-
| `libdebug/` | Debugging utilities |
118
| `libstd/` | The standard library (imported and linked by default) |
9+
| `libextra/` | The "extras" library (slightly more peripheral code) |
1210
| `libgreen/` | The M:N runtime library |
1311
| `libnative/` | The 1:1 runtime library |
1412
| `libsyntax/` | The Rust parser and pretty-printer |
13+
| `libcollections/` | A collection of useful data structures and containers |
14+
| `libnum/` | Extended number support library (complex, rational, etc) |
1515
| `libtest/` | Rust's test-runner code |
1616
| ------------------- | --------------------------------------------------------- |
1717
| `libarena/` | The arena (a fast but limited) memory allocator |
18-
| `libbacktrace/` | The libbacktrace library |
19-
| `libcollections/` | A collection of useful data structures and containers |
2018
| `libflate/` | Simple compression library |
21-
| `libfmt_macros/` | Macro support for format strings |
2219
| `libfourcc/` | Data format identifier library |
2320
| `libgetopts/` | Get command-line-options library |
2421
| `libglob/` | Unix glob patterns library |
25-
| `libgraphviz/` | Generating files for Graphviz |
26-
| `libhexfloat/` | Hexadecimal floating-point literals |
27-
| `liblibc/` | Bindings for the C standard library |
28-
| `liblog/` | Utilities for program-wide and customizable logging |
29-
| `libnum/` | Extended number support library (complex, rational, etc) |
30-
| `librand/` | Random numbers and distributions |
3122
| `libregex/` | Regular expressions |
32-
| `libregex_macros/` | The regex! syntax extension |
3323
| `libsemver/` | Rust's semantic versioning library |
3424
| `libserialize/` | Encode-Decode types library |
3525
| `libsync/` | Concurrency mechanisms and primitives |
3626
| `libterm/` | ANSI color library for terminals |
3727
| `libtime/` | Time operations library |
38-
| `liburl/` | URL handling lirary |
3928
| `libuuid/` | UUID's handling code |
4029
| ------------------- | --------------------------------------------------------- |
4130
| `rt/` | The runtime system |

branches/try2/src/doc/complement-cheatsheet.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
**Int to string**
66

7-
Use [`ToStr`](std/to_str/trait.ToStr.html).
7+
Use [`ToStr`](../std/to_str/trait.ToStr.html).
88

99
~~~
1010
let x: int = 42;
@@ -13,8 +13,8 @@ let y: String = x.to_str().to_string();
1313

1414
**String to int**
1515

16-
Use [`FromStr`](std/from_str/trait.FromStr.html), and its helper function,
17-
[`from_str`](std/from_str/fn.from_str.html).
16+
Use [`FromStr`](../std/from_str/trait.FromStr.html), and its helper function,
17+
[`from_str`](../std/from_str/fn.from_str.html).
1818

1919
~~~
2020
let x: Option<int> = from_str("42");
@@ -35,8 +35,8 @@ let y: String = format!("{:X}", x); // uppercase hexadecimal
3535

3636
**String to int, in non-base-10**
3737

38-
Use [`FromStrRadix`](std/num/trait.FromStrRadix.html), and its helper
39-
function, [`from_str_radix`](std/num/fn.from_str_radix.html).
38+
Use [`FromStrRadix`](../std/num/trait.FromStrRadix.html), and its helper
39+
function, [`from_str_radix`](../std/num/fn.from_str_radix.html).
4040

4141
~~~
4242
use std::num;
@@ -48,7 +48,7 @@ let y: i64 = x.unwrap();
4848
**Vector of Bytes to String**
4949

5050
To return a Borrowed String Slice (&str) use the str helper function
51-
[`from_utf8`](std/str/fn.from_utf8.html).
51+
[`from_utf8`](../std/str/fn.from_utf8.html).
5252

5353
~~~
5454
use std::str;
@@ -58,7 +58,7 @@ let x: &str = str::from_utf8(bytes).unwrap();
5858
~~~
5959

6060
To return an Owned String use the str helper function
61-
[`from_utf8_owned`](std/str/fn.from_utf8_owned.html).
61+
[`from_utf8_owned`](../std/str/fn.from_utf8_owned.html).
6262

6363
~~~
6464
use std::str;
@@ -68,8 +68,8 @@ let x: Option<String> =
6868
let y: String = x.unwrap();
6969
~~~
7070

71-
To return a [`MaybeOwned`](std/str/type.MaybeOwned.html) use the str helper
72-
function [`from_utf8_lossy`](std/str/fn.from_utf8_owned.html).
71+
To return a [`MaybeOwned`](../std/str/enum.MaybeOwned.html) use the str helper
72+
function [`from_utf8_lossy`](../std/str/fn.from_utf8_owned.html).
7373
This function also replaces non-valid utf-8 sequences with U+FFFD replacement
7474
character.
7575

@@ -103,11 +103,11 @@ contained data as a `&mut [T]`.
103103
## How do I read from a file?
104104

105105
Use
106-
[`File::open`](std/io/fs/struct.File.html#method.open)
106+
[`File::open`](../std/io/fs/struct.File.html#method.open)
107107
to create a
108-
[`File`](std/io/fs/struct.File.html)
108+
[`File`](../std/io/fs/struct.File.html)
109109
struct, which implements the
110-
[`Reader`](std/io/trait.Reader.html)
110+
[`Reader`](../std/io/trait.Reader.html)
111111
trait.
112112

113113
~~~ {.ignore}
@@ -121,8 +121,7 @@ let reader : File = File::open(&path).unwrap_or_else(on_error);
121121

122122
## How do I iterate over the lines in a file?
123123

124-
Use the [`lines`](std/io/trait.Buffer.html#method.lines) method on a
125-
[`BufferedReader`](std/io/struct.BufferedReader.html).
124+
Use the [`lines`](../std/io/trait.Buffer.html#method.lines) method on a [`BufferedReader`](../std/io/buffered/struct.BufferedReader.html).
126125

127126
~~~
128127
use std::io::BufferedReader;
@@ -140,7 +139,7 @@ for line in reader.lines() {
140139

141140
## How do I search for a substring?
142141

143-
Use the [`find_str`](std/str/trait.StrSlice.html#tymethod.find_str) method.
142+
Use the [`find_str`](../std/str/trait.StrSlice.html#tymethod.find_str) method.
144143

145144
~~~
146145
let str = "Hello, this is some random string";
@@ -151,7 +150,7 @@ let index: Option<uint> = str.find_str("rand");
151150

152151
## How do I get the length of a vector?
153152

154-
The [`Container`](std/container/trait.Container.html) trait provides the `len` method.
153+
The [`Container`](../std/container/trait.Container.html) trait provides the `len` method.
155154

156155
~~~
157156
let u: Vec<u32> = vec![0, 1, 2];
@@ -163,7 +162,7 @@ println!("u: {}, v: {}, w: {}", u.len(), v.len(), w.len()); // 3, 4, 5
163162

164163
## How do I iterate over a vector?
165164

166-
Use the [`iter`](std/slice/trait.ImmutableVector.html#tymethod.iter) method.
165+
Use the [`iter`](../std/vec/trait.ImmutableVector.html#tymethod.iter) method.
167166

168167
~~~
169168
let values: Vec<int> = vec![1, 2, 3, 4, 5];
@@ -172,9 +171,9 @@ for value in values.iter() { // value: &int
172171
}
173172
~~~
174173

175-
(See also [`mut_iter`](std/slice/trait.MutableVector.html#tymethod.mut_iter)
174+
(See also [`mut_iter`](../std/vec/trait.MutableVector.html#tymethod.mut_iter)
176175
which yields `&mut int` and
177-
[`move_iter`](std/slice/trait.OwnedVector.html#tymethod.move_iter) which yields
176+
[`move_iter`](../std/vec/trait.OwnedVector.html#tymethod.move_iter) which yields
178177
`int` while consuming the `values` vector.)
179178

180179
# Type system
@@ -255,7 +254,7 @@ Note: The Rust signatures should be wrapped in an `extern "ABI" { ... }` block.
255254

256255
You might see things like this in C APIs:
257256

258-
~~~c
257+
~~~ {.notrust}
259258
typedef struct Window Window;
260259
Window* createWindow(int width, int height);
261260
~~~

branches/try2/src/doc/complement-lang-faq.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Some examples that demonstrate different aspects of the language:
2121
* The extra library's [json] module. Enums and pattern matching
2222

2323
[sprocketnes]: https://github.com/pcwalton/sprocketnes
24-
[hash]: https://github.com/mozilla/rust/blob/master/src/libstd/hash/mod.rs
24+
[hash]: https://github.com/mozilla/rust/blob/master/src/libstd/hash.rs
2525
[HashMap]: https://github.com/mozilla/rust/blob/master/src/libcollections/hashmap.rs
2626
[json]: https://github.com/mozilla/rust/blob/master/src/libserialize/json.rs
2727

@@ -135,7 +135,7 @@ For simplicity, we do not plan to do so. Implementing automatic semicolon insert
135135

136136
**Short answer** set the RUST_LOG environment variable to the name of your source file, sans extension.
137137

138-
```sh
138+
```notrust,sh
139139
rustc hello.rs
140140
export RUST_LOG=hello
141141
./hello
@@ -149,6 +149,6 @@ example we were setting RUST_LOG to the name of the hello crate. Multiple paths
149149
can be combined to control the exact logging you want to see. For example, when
150150
debugging linking in the compiler you might set
151151
`RUST_LOG=rustc::metadata::creader,rustc::util::filesearch,rustc::back::rpath`
152-
For a full description see [the logging crate][1].
152+
For a full description see [the language reference][1].
153153

154-
[1]:log/index.html
154+
[1]:http://doc.rust-lang.org/doc/master/rust.html#logging-system

branches/try2/src/doc/guide-ffi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ fn main() {
229229

230230
C code:
231231

232-
~~~~c
232+
~~~~ {.notrust}
233233
typedef void (*rust_callback)(int32_t);
234234
rust_callback cb;
235235
@@ -296,7 +296,7 @@ fn main() {
296296

297297
C code:
298298

299-
~~~~c
299+
~~~~ {.notrust}
300300
typedef void (*rust_callback)(int32_t);
301301
void* cb_target;
302302
rust_callback cb;

branches/try2/src/doc/guide-lifetimes.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Now we can call `compute_distance()`:
6767
# let on_the_stack : Point = Point{x: 3.0, y: 4.0};
6868
# let on_the_heap : Box<Point> = box Point{x: 7.0, y: 9.0};
6969
# fn compute_distance(p1: &Point, p2: &Point) -> f64 { 0.0 }
70-
compute_distance(&on_the_stack, on_the_heap);
70+
compute_distance(&on_the_stack, &*on_the_heap);
7171
~~~
7272

7373
Here, the `&` operator takes the address of the variable
@@ -77,10 +77,9 @@ value. We also call this _borrowing_ the local variable
7777
`on_the_stack`, because we have created an alias: that is, another
7878
name for the same data.
7979

80-
In the case of `on_the_heap`, however, no explicit action is necessary.
81-
The compiler will automatically convert a box box point to a reference like &point.
82-
This is another form of borrowing; in this case, the contents of the owned box
83-
are being lent out.
80+
For the second argument, we need to extract the contents of `on_the_heap`
81+
by derefercing with the `*` symbol. Now that we have the data, we need
82+
to create a reference with the `&` symbol.
8483

8584
Whenever a caller lends data to a callee, there are some limitations on what
8685
the caller can do with the original. For example, if the contents of a
@@ -218,7 +217,7 @@ fn example3() -> int {
218217
To make this clearer, consider this diagram showing the state of
219218
memory immediately before the re-assignment of `x`:
220219

221-
~~~ {.text}
220+
~~~ {.notrust}
222221
Stack Exchange Heap
223222
224223
x +-------------+
@@ -232,7 +231,7 @@ memory immediately before the re-assignment of `x`:
232231

233232
Once the reassignment occurs, the memory will look like this:
234233

235-
~~~ {.text}
234+
~~~ {.notrust}
236235
Stack Exchange Heap
237236
238237
x +-------------+ +---------+
@@ -329,7 +328,7 @@ to a pointer of type `&size` into the _interior of the enum_.
329328
To make this more clear, let's look at a diagram of memory layout in
330329
the case where `shape` points at a rectangle:
331330

332-
~~~ {.text}
331+
~~~ {.notrust}
333332
Stack Memory
334333
335334
+-------+ +---------------+
@@ -354,7 +353,7 @@ to store that shape value would still be valid, _it would have a
354353
different type_! The following diagram shows what memory would look
355354
like if code overwrote `shape` with a circle:
356355

357-
~~~ {.text}
356+
~~~ {.notrust}
358357
Stack Memory
359358
360359
+-------+ +---------------+

branches/try2/src/doc/guide-pointers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn main() {
3131

3232
And now I get an error:
3333

34-
~~~text
34+
~~~ {.notrust}
3535
error: mismatched types: expected `&int` but found `<generic integer #0>` (expected &-ptr but found integral variable)
3636
~~~
3737

@@ -201,7 +201,7 @@ fn main() {
201201

202202
This prints:
203203

204-
~~~text
204+
~~~ {.notrust}
205205
Cons(1, box Cons(2, box Cons(3, box Nil)))
206206
~~~
207207

@@ -347,7 +347,7 @@ fn main() {
347347

348348
It gives this error:
349349

350-
~~~text
350+
~~~ {.notrust}
351351
test.rs:5:8: 5:10 error: cannot assign to `*x` because it is borrowed
352352
test.rs:5 *x -= 1;
353353
^~

0 commit comments

Comments
 (0)