Skip to content

Commit 195e0f1

Browse files
committed
---
yaml --- r: 138124 b: refs/heads/try c: f006e86 h: refs/heads/master v: v3
1 parent 673848e commit 195e0f1

File tree

111 files changed

+833
-536
lines changed

Some content is hidden

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

111 files changed

+833
-536
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: b6e0d3a5bf4c88650a22f605f822e02c6b163580
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
5-
refs/heads/try: ed7d1be12f61e8a863c8c1cb645ca12f9ce38721
5+
refs/heads/try: f006e86eed710111f9f62da88cfe3b3a333fe775
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ fetch snapshots, and an OS that can execute the available snapshot binaries.
8787

8888
Snapshot binaries are currently built and tested on several platforms:
8989

90-
* Windows (7, 8, Server 2008 R2), x86 only
90+
* Windows (7, 8, Server 2008 R2), x86 and x86-64 (64-bit support added in Rust 0.12.0)
9191
* Linux (2.6.18 or later, various distributions), x86 and x86-64
9292
* OSX 10.7 (Lion) or greater, x86 and x86-64
9393

branches/try/mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ tidy:
284284
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
285285
$(Q)echo $(ALL_HS) \
286286
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
287-
$(Q)find $(S)src -type f -perm a+x \
287+
$(Q)find $(S)src -type f -perm +a+x \
288288
-not -name '*.rs' -and -not -name '*.py' \
289289
-and -not -name '*.sh' \
290290
| grep '^$(S)src/jemalloc' -v \

branches/try/src/compiletest/runtest.rs

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -947,15 +947,12 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
947947
String::from_chars(c.as_slice())
948948
}
949949

950-
#[cfg(target_os = "windows")]
950+
#[cfg(windows)]
951951
fn prefix_matches( line : &str, prefix : &str ) -> bool {
952952
to_lower(line).as_slice().starts_with(to_lower(prefix).as_slice())
953953
}
954954

955-
#[cfg(any(target_os = "linux",
956-
target_os = "macos",
957-
target_os = "freebsd",
958-
target_os = "dragonfly"))]
955+
#[cfg(unix)]
959956
fn prefix_matches( line : &str, prefix : &str ) -> bool {
960957
line.starts_with( prefix )
961958
}
@@ -1356,24 +1353,21 @@ fn program_output(config: &Config, testfile: &Path, lib_path: &str, prog: String
13561353
}
13571354

13581355
// Linux and mac don't require adjusting the library search path
1359-
#[cfg(any(target_os = "linux",
1360-
target_os = "macos",
1361-
target_os = "freebsd",
1362-
target_os = "dragonfly"))]
1356+
#[cfg(unix)]
13631357
fn make_cmdline(_libpath: &str, prog: &str, args: &[String]) -> String {
13641358
format!("{} {}", prog, args.connect(" "))
13651359
}
13661360

1367-
#[cfg(target_os = "windows")]
1361+
#[cfg(windows)]
13681362
fn make_cmdline(libpath: &str, prog: &str, args: &[String]) -> String {
1369-
format!("{} {} {}", lib_path_cmd_prefix(libpath), prog, args.connect(" "))
1370-
}
13711363

1372-
// Build the LD_LIBRARY_PATH variable as it would be seen on the command line
1373-
// for diagnostic purposes
1374-
#[cfg(target_os = "windows")]
1375-
fn lib_path_cmd_prefix(path: &str) -> String {
1376-
format!("{}=\"{}\"", util::lib_path_env_var(), util::make_new_path(path))
1364+
// Build the LD_LIBRARY_PATH variable as it would be seen on the command line
1365+
// for diagnostic purposes
1366+
fn lib_path_cmd_prefix(path: &str) -> String {
1367+
format!("{}=\"{}\"", util::lib_path_env_var(), util::make_new_path(path))
1368+
}
1369+
1370+
format!("{} {} {}", lib_path_cmd_prefix(libpath), prog, args.connect(" "))
13771371
}
13781372

13791373
fn dump_output(config: &Config, testfile: &Path, out: &str, err: &str) {

branches/try/src/doc/README.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Dependencies
1+
# Rust documentations
2+
3+
## Dependencies
24

35
[Pandoc](http://johnmacfarlane.net/pandoc/installing.html), a universal
46
document converter, is required to generate docs as HTML from Rust's
@@ -10,7 +12,7 @@ docs from the master (English) docs.
1012
[GNU gettext](http://www.gnu.org/software/gettext/) is required for managing
1113
the translation data.
1214

13-
# Building
15+
## Building
1416

1517
To generate all the docs, just run `make docs` from the root of the repository.
1618
This will convert the distributed Markdown docs to HTML and generate HTML doc
@@ -24,7 +26,7 @@ rustdoc --output html-doc/ --output-format html ../src/libstd/path.rs
2426

2527
(This, of course, requires a working build of the `rustdoc` tool.)
2628

27-
# Additional notes
29+
## Additional notes
2830

2931
To generate an HTML version of a doc from Markdown manually, you can do
3032
something like:
@@ -33,37 +35,39 @@ something like:
3335
pandoc --from=markdown --to=html5 --number-sections -o reference.html reference.md
3436
~~~~
3537

36-
(reference.md being the Rust Reference Manual.)
38+
(`reference.md` being the Rust Reference Manual.)
3739

3840
The syntax for pandoc flavored markdown can be found at:
39-
http://johnmacfarlane.net/pandoc/README.html#pandocs-markdown
41+
42+
- http://johnmacfarlane.net/pandoc/README.html#pandocs-markdown
4043

4144
A nice quick reference (for non-pandoc markdown) is at:
42-
http://kramdown.rubyforge.org/quickref.html
4345

44-
# Notes for translators
46+
- http://kramdown.gettalong.org/quickref.html
47+
48+
## Notes for translators
4549

4650
Notice: The procedure described below is a work in progress. We are working on
4751
translation system but the procedure contains some manual operations for now.
4852

49-
To start the translation for a new language, see po4a.conf at first.
53+
To start the translation for a new language, see `po4a.conf` at first.
5054

51-
To generate .pot and .po files, do something like:
55+
To generate `.pot` and `.po` files, do something like:
5256

5357
~~~~
5458
po4a --copyright-holder="The Rust Project Developers" \
5559
--package-name="Rust" \
56-
--package-version="0.11.0" \
60+
--package-version="0.13.0" \
5761
-M UTF-8 -L UTF-8 \
5862
src/doc/po4a.conf
5963
~~~~
6064

61-
(the version number must be changed if it is not 0.11.0 now.)
65+
(the version number must be changed if it is not `0.13.0` now.)
6266

63-
Now you can translate documents with .po files, commonly used with gettext. If
67+
Now you can translate documents with `.po` files, commonly used with gettext. If
6468
you are not familiar with gettext-based translation, please read the online
6569
manual linked from http://www.gnu.org/software/gettext/ . We use UTF-8 as the
66-
file encoding of .po files.
70+
file encoding of `.po` files.
6771

6872
When you want to make a commit, do the command below before staging your
6973
change:
@@ -79,4 +83,4 @@ for f in src/doc/po/**/*.po; do
7983
done
8084
~~~~
8185

82-
This removes untranslated entries from .po files to save disk space.
86+
This removes untranslated entries from `.po` files to save disk space.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ conventions. Rust provides a way to tell the compiler which convention to use:
475475
~~~~
476476
extern crate libc;
477477

478-
#[cfg(target_os = "win32", target_arch = "x86")]
478+
#[cfg(all(target_os = "win32", target_arch = "x86"))]
479479
#[link(name = "kernel32")]
480480
#[allow(non_snake_case)]
481481
extern "stdcall" {

branches/try/src/doc/guide-strings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,5 +206,5 @@ Many more bytes than graphemes!
206206

207207
# Other Documentation
208208

209-
* [the `&str` API documentation](/std/str/index.html)
209+
* [the `&str` API documentation](std/str/index.html)
210210
* [the `String` API documentation](std/string/index.html)

branches/try/src/doc/guide-unsafe.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -313,17 +313,15 @@ literal string (i.e `""`)
313313
```
314314
#![feature(asm)]
315315
316-
#[cfg(target_arch = "x86")]
317-
#[cfg(target_arch = "x86_64")]
316+
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
318317
fn foo() {
319318
unsafe {
320319
asm!("NOP");
321320
}
322321
}
323322
324323
// other platforms
325-
#[cfg(not(target_arch = "x86"),
326-
not(target_arch = "x86_64"))]
324+
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
327325
fn foo() { /* ... */ }
328326
329327
fn main() {
@@ -340,7 +338,7 @@ but you must add the right number of `:` if you skip them:
340338

341339
```
342340
# #![feature(asm)]
343-
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
341+
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
344342
# fn main() { unsafe {
345343
asm!("xor %eax, %eax"
346344
:
@@ -354,7 +352,7 @@ Whitespace also doesn't matter:
354352

355353
```
356354
# #![feature(asm)]
357-
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
355+
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
358356
# fn main() { unsafe {
359357
asm!("xor %eax, %eax" ::: "eax");
360358
# } }
@@ -368,7 +366,7 @@ expressions must be mutable lvalues:
368366

369367
```
370368
# #![feature(asm)]
371-
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
369+
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
372370
fn add(a: int, b: int) -> int {
373371
let mut c = 0;
374372
unsafe {
@@ -379,7 +377,7 @@ fn add(a: int, b: int) -> int {
379377
}
380378
c
381379
}
382-
# #[cfg(not(target_arch = "x86"), not(target_arch = "x86_64"))]
380+
# #[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
383381
# fn add(a: int, b: int) -> int { a + b }
384382
385383
fn main() {
@@ -396,7 +394,7 @@ stay valid.
396394

397395
```
398396
# #![feature(asm)]
399-
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
397+
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
400398
# fn main() { unsafe {
401399
// Put the value 0x200 in eax
402400
asm!("mov $$0x200, %eax" : /* no outputs */ : /* no inputs */ : "eax");

branches/try/src/doc/guide.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,8 +1746,7 @@ For our first project, we'll implement a classic beginner programming problem:
17461746
the guessing game. Here's how it works: Our program will generate a random
17471747
integer between one and a hundred. It will then prompt us to enter a guess.
17481748
Upon entering our guess, it will tell us if we're too low or too high. Once we
1749-
guess correctly, it will congratulate us, and print the number of guesses we've
1750-
taken to the screen. Sound good?
1749+
guess correctly, it will congratulate us. Sound good?
17511750

17521751
## Set up
17531752

@@ -5061,8 +5060,8 @@ println!("The value of x[0] is: {}", x[0]); // error: use of moved value: `x`
50615060
```
50625061

50635062
`x` is now owned by the proc, and so we can't use it anymore. Many other
5064-
languages would let us do this, but it's not safe to do so. Rust's type system
5065-
catches the error.
5063+
languages would let us do this, but it's not safe to do so. Rust's borrow
5064+
checker catches the error.
50665065

50675066
If tasks were only able to capture these values, they wouldn't be very useful.
50685067
Luckily, tasks can communicate with each other through **channel**s. Channels

branches/try/src/doc/reference.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -185,40 +185,24 @@ grammar as double-quoted strings. Other tokens have exact rules given.
185185

186186
### Keywords
187187

188-
The keywords are the following strings, organized by first letter:
188+
<p id="keyword-table-marker">The keywords are the following strings, organized by first letter:</p>
189189

190-
<div id="keywords">
191190
| | | | |
192191
|----------|--------|--------|-------|
193192
| as | | | |
194-
|----------|--------|--------|-------|
195193
| box | break | | |
196-
|----------|--------|--------|-------|
197194
| continue | crate | | |
198-
|----------|--------|--------|-------|
199195
| else | enum | extern | |
200-
|----------|--------|--------|-------|
201196
| false | fn | for | |
202-
|----------|--------|--------|-------|
203197
| if | impl | in | |
204-
|----------|--------|--------|-------|
205198
| let | loop | | |
206-
|----------|--------|--------|-------|
207199
| match | mod | mut | |
208-
|----------|--------|--------|-------|
209200
| priv | proc | pub | |
210-
|----------|--------|--------|-------|
211201
| ref | return | | |
212-
|----------|--------|--------|-------|
213202
| self | static | struct | super |
214-
|----------|--------|--------|-------|
215203
| trait | true | type | |
216-
|----------|--------|--------|-------|
217204
| unsafe | use | | |
218-
|----------|--------|--------|-------|
219205
| while | | | |
220-
|----------|--------|--------|-------|
221-
</div>
222206

223207
Each of these keywords has special meaning in its grammar, and all of them are
224208
excluded from the `ident` rule.
@@ -2049,26 +2033,28 @@ fn macos_only() {
20492033
}
20502034
20512035
// This function is only included when either foo or bar is defined
2052-
#[cfg(foo)]
2053-
#[cfg(bar)]
2036+
#[cfg(any(foo, bar))]
20542037
fn needs_foo_or_bar() {
20552038
// ...
20562039
}
20572040
20582041
// This function is only included when compiling for a unixish OS with a 32-bit
20592042
// architecture
2060-
#[cfg(unix, target_word_size = "32")]
2043+
#[cfg(all(unix, target_word_size = "32"))]
20612044
fn on_32bit_unix() {
20622045
// ...
20632046
}
2047+
2048+
// This function is only included when foo is not defined
2049+
#[cfg(not(foo))]
2050+
fn needs_not_foo() {
2051+
// ...
2052+
}
20642053
```
20652054

20662055
This illustrates some conditional compilation can be achieved using the
2067-
`#[cfg(...)]` attribute. Note that `#[cfg(foo, bar)]` is a condition that needs
2068-
both `foo` and `bar` to be defined while `#[cfg(foo)] #[cfg(bar)]` only needs
2069-
one of `foo` and `bar` to be defined (this resembles in the disjunctive normal
2070-
form). Additionally, one can reverse a condition by enclosing it in a
2071-
`not(...)`, like e. g. `#[cfg(not(target_os = "win32"))]`.
2056+
`#[cfg(...)]` attribute. `any`, `all` and `not` can be used to assemble
2057+
arbitrarily complex configurations through nesting.
20722058

20732059
The following configurations must be defined by the implementation:
20742060

@@ -2486,6 +2472,8 @@ The currently implemented features of the reference compiler are:
24862472

24872473
* `if_let` - Allows use of the `if let` syntax.
24882474

2475+
* `while_let` - Allows use of the `while let` syntax.
2476+
24892477
* `intrinsics` - Allows use of the "rust-intrinsics" ABI. Compiler intrinsics
24902478
are inherently unstable and no promise about them is made.
24912479

@@ -3492,6 +3480,18 @@ of a condition expression it expects a refutable let statement. If the value of
34923480
expression on the right hand side of the let statement matches the pattern, the corresponding
34933481
block will execute, otherwise flow proceeds to the first `else` block that follows.
34943482

3483+
### While let loops
3484+
3485+
```{.ebnf .gram}
3486+
while_let_expr : "while" "let" pat '=' expr '{' block '}' ;
3487+
```
3488+
3489+
A `while let` loop is semantically identical to a `while` loop but in place of a
3490+
condition expression it expects a refutable let statement. If the value of the
3491+
expression on the right hand side of the let statement matches the pattern, the
3492+
loop body block executes and control returns to the pattern matching statement.
3493+
Otherwise, the while expression completes.
3494+
34953495
### Return expressions
34963496

34973497
```{.ebnf .gram}

branches/try/src/doc/rust.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,4 +393,9 @@ pre.rust { position: relative; }
393393
}
394394
}
395395

396-
#keywords table td { border: none; }
396+
#keyword-table-marker + table thead { display: none; }
397+
#keyword-table-marker + table td { border: none; }
398+
#keyword-table-marker + table {
399+
margin-left: 2em;
400+
margin-bottom: 1em;
401+
}

branches/try/src/liballoc/arc.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@ impl<T: Sync + Send> Drop for Weak<T> {
276276
#[allow(experimental)]
277277
mod tests {
278278
use std::clone::Clone;
279-
use std::collections::MutableSeq;
280279
use std::comm::channel;
281280
use std::mem::drop;
282281
use std::ops::Drop;

0 commit comments

Comments
 (0)