Skip to content

Commit e75d207

Browse files
committed
---
yaml --- r: 98215 b: refs/heads/master c: 4d5da45 h: refs/heads/master i: 98213: c24614a 98211: 9cfb807 98207: 57844fd v: v3
1 parent 6beebc7 commit e75d207

File tree

195 files changed

+5225
-7278
lines changed

Some content is hidden

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

195 files changed

+5225
-7278
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: f3f2e697d8d21190bb99e86bae2de39f012162aa
2+
refs/heads/master: 4d5da45e7ecae3c71b93fd5a89e2f41d713e529b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: b6400f998497c3958f40997a71756ead344a776d
55
refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36

trunk/doc/complement-cheatsheet.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ let reader : File = File::open(&path).unwrap_or_else(on_error);
6262
Use the [`lines`](http://static.rust-lang.org/doc/master/std/io/trait.Buffer.html#method.lines) method on a [`BufferedReader`](http://static.rust-lang.org/doc/master/std/io/buffered/struct.BufferedReader.html).
6363

6464
~~~
65-
use std::io::BufferedReader;
66-
# use std::io::MemReader;
65+
use std::io::buffered::BufferedReader;
66+
# use std::io::mem::MemReader;
6767
6868
# let reader = MemReader::new(~[]);
6969

trunk/doc/guide-conditions.md

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ An example program that does this task reads like this:
4646
~~~~
4747
# #[allow(unused_imports)];
4848
# extern mod extra;
49-
use std::io::{BufferedReader, File};
49+
use std::io::buffered::BufferedReader;
50+
use std::io::File;
5051
# mod BufferedReader {
5152
# use std::io::File;
52-
# use std::io::MemReader;
53-
# use std::io::BufferedReader;
53+
# use std::io::mem::MemReader;
54+
# use std::io::buffered::BufferedReader;
5455
# static s : &'static [u8] = bytes!("1 2\n\
5556
# 34 56\n\
5657
# 789 123\n\
@@ -244,12 +245,13 @@ and trapping its exit status using `task::try`:
244245
~~~~
245246
# #[allow(unused_imports)];
246247
# extern mod extra;
247-
use std::io::{BufferedReader, File};
248+
use std::io::buffered::BufferedReader;
249+
use std::io::File;
248250
use std::task;
249251
# mod BufferedReader {
250252
# use std::io::File;
251-
# use std::io::MemReader;
252-
# use std::io::BufferedReader;
253+
# use std::io::mem::MemReader;
254+
# use std::io::buffered::BufferedReader;
253255
# static s : &'static [u8] = bytes!("1 2\n\
254256
# 34 56\n\
255257
# 789 123\n\
@@ -348,11 +350,12 @@ but similarly clear as the version that used `fail!` in the logic where the erro
348350
~~~~
349351
# #[allow(unused_imports)];
350352
# extern mod extra;
351-
use std::io::{BufferedReader, File};
353+
use std::io::buffered::BufferedReader;
354+
use std::io::File;
352355
# mod BufferedReader {
353356
# use std::io::File;
354-
# use std::io::MemReader;
355-
# use std::io::BufferedReader;
357+
# use std::io::mem::MemReader;
358+
# use std::io::buffered::BufferedReader;
356359
# static s : &'static [u8] = bytes!("1 2\n\
357360
# 34 56\n\
358361
# 789 123\n\
@@ -417,11 +420,12 @@ and replaces bad input lines with the pair `(-1,-1)`:
417420
~~~~
418421
# #[allow(unused_imports)];
419422
# extern mod extra;
420-
use std::io::{BufferedReader, File};
423+
use std::io::buffered::BufferedReader;
424+
use std::io::File;
421425
# mod BufferedReader {
422426
# use std::io::File;
423-
# use std::io::MemReader;
424-
# use std::io::BufferedReader;
427+
# use std::io::mem::MemReader;
428+
# use std::io::buffered::BufferedReader;
425429
# static s : &'static [u8] = bytes!("1 2\n\
426430
# 34 56\n\
427431
# 789 123\n\
@@ -492,11 +496,12 @@ Changing the condition's return type from `(int,int)` to `Option<(int,int)>` wil
492496
~~~~
493497
# #[allow(unused_imports)];
494498
# extern mod extra;
495-
use std::io::{BufferedReader, File};
499+
use std::io::buffered::BufferedReader;
500+
use std::io::File;
496501
# mod BufferedReader {
497502
# use std::io::File;
498-
# use std::io::MemReader;
499-
# use std::io::BufferedReader;
503+
# use std::io::mem::MemReader;
504+
# use std::io::buffered::BufferedReader;
500505
# static s : &'static [u8] = bytes!("1 2\n\
501506
# 34 56\n\
502507
# 789 123\n\
@@ -577,11 +582,12 @@ This can be encoded in the handler API by introducing a helper type: `enum Malfo
577582
~~~~
578583
# #[allow(unused_imports)];
579584
# extern mod extra;
585+
use std::io::buffered::BufferedReader;
580586
use std::io::File;
581587
# mod BufferedReader {
582588
# use std::io::File;
583-
# use std::io::MemReader;
584-
# use std::io::BufferedReader;
589+
# use std::io::mem::MemReader;
590+
# use std::io::buffered::BufferedReader;
585591
# static s : &'static [u8] = bytes!("1 2\n\
586592
# 34 56\n\
587593
# 789 123\n\
@@ -701,11 +707,12 @@ a second condition and a helper function will suffice:
701707
~~~~
702708
# #[allow(unused_imports)];
703709
# extern mod extra;
704-
use std::io::{BufferedReader, File};
710+
use std::io::buffered::BufferedReader;
711+
use std::io::File;
705712
# mod BufferedReader {
706713
# use std::io::File;
707-
# use std::io::MemReader;
708-
# use std::io::BufferedReader;
714+
# use std::io::mem::MemReader;
715+
# use std::io::buffered::BufferedReader;
709716
# static s : &'static [u8] = bytes!("1 2\n\
710717
# 34 56\n\
711718
# 789 123\n\

trunk/doc/guide-tasks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ be distributed on the available cores.
290290
fn partial_sum(start: uint) -> f64 {
291291
let mut local_sum = 0f64;
292292
for num in range(start*100000, (start+1)*100000) {
293-
local_sum += (num as f64 + 1.0).powf(&-2.0);
293+
local_sum += (num as f64 + 1.0).pow(&-2.0);
294294
}
295295
local_sum
296296
}
@@ -326,7 +326,7 @@ a single large vector of floats. Each task needs the full vector to perform its
326326
use extra::arc::Arc;
327327
328328
fn pnorm(nums: &~[f64], p: uint) -> f64 {
329-
nums.iter().fold(0.0, |a,b| a+(*b).powf(&(p as f64)) ).powf(&(1.0 / (p as f64)))
329+
nums.iter().fold(0.0, |a,b| a+(*b).pow(&(p as f64)) ).pow(&(1.0 / (p as f64)))
330330
}
331331
332332
fn main() {

trunk/doc/guide-testing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ mod tests {
6363
}
6464
~~~
6565

66-
Additionally `#[test]` items behave as if they also have the
67-
`#[cfg(test)]` attribute, and will not be compiled when the --test flag
66+
Additionally #[test] items behave as if they also have the
67+
#[cfg(test)] attribute, and will not be compiled when the --test flag
6868
is not used.
6969

7070
Tests that should not be run can be annotated with the 'ignore'

trunk/doc/rust.md

Lines changed: 36 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -806,9 +806,7 @@ path_glob : ident [ "::" path_glob ] ?
806806

807807
A _use declaration_ creates one or more local name bindings synonymous
808808
with some other [path](#paths).
809-
Usually a `use` declaration is used to shorten the path required to refer to a
810-
module item. These declarations may appear at the top of [modules](#modules) and
811-
[blocks](#blocks).
809+
Usually a `use` declaration is used to shorten the path required to refer to a module item.
812810

813811
*Note*: Unlike in many languages,
814812
`use` declarations in Rust do *not* declare linkage dependency with external crates.
@@ -2211,9 +2209,12 @@ dereferences (`*expr`), [indexing expressions](#index-expressions)
22112209
(`expr[expr]`), and [field references](#field-expressions) (`expr.f`).
22122210
All other expressions are rvalues.
22132211

2214-
The left operand of an [assignment](#assignment-expressions) or
2212+
The left operand of an [assignment](#assignment-expressions),
2213+
[binary move](#binary-move-expressions) or
22152214
[compound-assignment](#compound-assignment-expressions) expression is an lvalue context,
2216-
as is the single operand of a unary [borrow](#unary-operator-expressions).
2215+
as is the single operand of a unary [borrow](#unary-operator-expressions),
2216+
or [move](#unary-move-expressions) expression,
2217+
and _both_ operands of a [swap](#swap-expressions) expression.
22172218
All other expression contexts are rvalue contexts.
22182219

22192220
When an lvalue is evaluated in an _lvalue context_, it denotes a memory location;
@@ -2226,8 +2227,9 @@ A temporary's lifetime equals the largest lifetime of any reference that points
22262227

22272228
When a [local variable](#memory-slots) is used
22282229
as an [rvalue](#lvalues-rvalues-and-temporaries)
2229-
the variable will either be moved or copied, depending on its type.
2230-
For types that contain [owning pointers](#pointer-types)
2230+
the variable will either be [moved](#move-expressions) or copied,
2231+
depending on its type.
2232+
For types that contain [owning pointers](#owning-pointers)
22312233
or values that implement the special trait `Drop`,
22322234
the variable is moved.
22332235
All other types are copied.
@@ -2316,24 +2318,14 @@ let base = Point3d {x: 1, y: 2, z: 3};
23162318
Point3d {y: 0, z: 10, .. base};
23172319
~~~~
23182320

2319-
### Block expressions
2321+
### Record expressions
23202322

23212323
~~~~ {.ebnf .gram}
2322-
block_expr : '{' [ view_item ] *
2323-
[ stmt ';' | item ] *
2324-
[ expr ] '}'
2324+
rec_expr : '{' ident ':' expr
2325+
[ ',' ident ':' expr ] *
2326+
[ ".." expr ] '}'
23252327
~~~~
23262328

2327-
A _block expression_ is similar to a module in terms of the declarations that
2328-
are possible. Each block conceptually introduces a new namespace scope. View
2329-
items can bring new names into scopes and declared items are in scope for only
2330-
the block itself.
2331-
2332-
A block will execute each statement sequentially, and then execute the
2333-
expression (if given). If the final expression is omitted, the type and return
2334-
value of the block are `()`, but if it is provided, the type and return value
2335-
of the block are that of the expression itself.
2336-
23372329
### Method-call expressions
23382330

23392331
~~~~ {.ebnf .gram}
@@ -2886,26 +2878,16 @@ match x {
28862878

28872879
The first pattern matches lists constructed by applying `Cons` to any head value, and a
28882880
tail value of `~Nil`. The second pattern matches _any_ list constructed with `Cons`,
2889-
ignoring the values of its arguments. The difference between `_` and `*` is that the pattern
2890-
`C(_)` is only type-correct if `C` has exactly one argument, while the pattern `C(..)` is
2891-
type-correct for any enum variant `C`, regardless of how many arguments `C` has.
2892-
2893-
A `match` behaves differently depending on whether or not the head expression
2894-
is an [lvalue or an rvalue](#lvalues-rvalues-and-temporaries).
2895-
If the head expression is an rvalue, it is
2896-
first evaluated into a temporary location, and the resulting value
2897-
is sequentially compared to the patterns in the arms until a match
2881+
ignoring the values of its arguments. The difference between `_` and `*` is that the pattern `C(_)` is only type-correct if
2882+
`C` has exactly one argument, while the pattern `C(..)` is type-correct for any enum variant `C`, regardless of how many arguments `C` has.
2883+
2884+
To execute an `match` expression, first the head expression is evaluated, then
2885+
its value is sequentially compared to the patterns in the arms until a match
28982886
is found. The first arm with a matching pattern is chosen as the branch target
28992887
of the `match`, any variables bound by the pattern are assigned to local
29002888
variables in the arm's block, and control enters the block.
29012889

2902-
When the head expression is an lvalue, the match does not allocate a
2903-
temporary location (however, a by-value binding may copy or move from
2904-
the lvalue). When possible, it is preferable to match on lvalues, as the
2905-
lifetime of these matches inherits the lifetime of the lvalue, rather
2906-
than being restricted to the inside of the match.
2907-
2908-
An example of a `match` expression:
2890+
An example of an `match` expression:
29092891

29102892
~~~~
29112893
# fn process_pair(a: int, b: int) { }
@@ -2935,31 +2917,19 @@ Patterns that bind variables
29352917
default to binding to a copy or move of the matched value
29362918
(depending on the matched value's type).
29372919
This can be changed to bind to a reference by
2938-
using the `ref` keyword,
2939-
or to a mutable reference using `ref mut`.
2940-
2941-
Patterns can also dereference pointers by using the `&`,
2942-
`~` or `@` symbols, as appropriate. For example, these two matches
2943-
on `x: &int` are equivalent:
2944-
2945-
~~~~
2946-
# let x = &3;
2947-
let y = match *x { 0 => "zero", _ => "some" };
2948-
let z = match x { &0 => "zero", _ => "some" };
2949-
2950-
assert_eq!(y, z);
2951-
~~~~
2952-
2953-
A pattern that's just an identifier, like `Nil` in the previous answer,
2954-
could either refer to an enum variant that's in scope, or bind a new variable.
2955-
The compiler resolves this ambiguity by forbidding variable bindings that occur
2956-
in `match` patterns from shadowing names of variants that are in scope.
2957-
For example, wherever `List` is in scope,
2958-
a `match` pattern would not be able to bind `Nil` as a new name.
2959-
The compiler interprets a variable pattern `x` as a binding _only_ if there is
2960-
no variant named `x` in scope.
2961-
A convention you can use to avoid conflicts is simply to name variants with
2962-
upper-case letters, and local variables with lower-case letters.
2920+
using the ```ref``` keyword,
2921+
or to a mutable reference using ```ref mut```.
2922+
2923+
A pattern that's just an identifier,
2924+
like `Nil` in the previous answer,
2925+
could either refer to an enum variant that's in scope,
2926+
or bind a new variable.
2927+
The compiler resolves this ambiguity by forbidding variable bindings that occur in ```match``` patterns from shadowing names of variants that are in scope.
2928+
For example, wherever ```List``` is in scope,
2929+
a ```match``` pattern would not be able to bind ```Nil``` as a new name.
2930+
The compiler interprets a variable pattern `x` as a binding _only_ if there is no variant named `x` in scope.
2931+
A convention you can use to avoid conflicts is simply to name variants with upper-case letters,
2932+
and local variables with lower-case letters.
29632933

29642934
Multiple match patterns may be joined with the `|` operator.
29652935
A range of values may be specified with `..`.
@@ -3140,20 +3110,19 @@ A `struct` *type* is a heterogeneous product of other types, called the *fields*
31403110
the *record* types of the ML family,
31413111
or the *structure* types of the Lisp family.]
31423112

3143-
New instances of a `struct` can be constructed with a [struct expression](#structure-expressions).
3113+
New instances of a `struct` can be constructed with a [struct expression](#struct-expressions).
31443114

31453115
The memory order of fields in a `struct` is given by the item defining it.
31463116
Fields may be given in any order in a corresponding struct *expression*;
31473117
the resulting `struct` value will always be laid out in memory in the order specified by the corresponding *item*.
31483118

3149-
The fields of a `struct` may be qualified by [visibility modifiers](#re-exporting-and-visibility),
3119+
The fields of a `struct` may be qualified by [visibility modifiers](#visibility-modifiers),
31503120
to restrict access to implementation-private data in a structure.
31513121

31523122
A _tuple struct_ type is just like a structure type, except that the fields are anonymous.
31533123

31543124
A _unit-like struct_ type is like a structure type, except that it has no fields.
3155-
The one value constructed by the associated [structure expression](#structure-expressions)
3156-
is the only value that inhabits such a type.
3125+
The one value constructed by the associated [structure expression](#structure-expression) is the only value that inhabits such a type.
31573126

31583127
### Enumerated types
31593128

@@ -3824,7 +3793,7 @@ over the output format of a Rust crate.
38243793
### Logging system
38253794

38263795
The runtime contains a system for directing [logging
3827-
expressions](#logging-expressions) to a logging console and/or internal logging
3796+
expressions](#log-expressions) to a logging console and/or internal logging
38283797
buffers. Logging can be enabled per module.
38293798

38303799
Logging output is enabled by setting the `RUST_LOG` environment

trunk/mk/docs.mk

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ CDOCS :=
1717
DOCS_L10N :=
1818
HTML_DEPS :=
1919

20-
BASE_DOC_OPTS := --standalone --toc --number-sections
21-
HTML_OPTS = $(BASE_DOC_OPTS) --to=html5 --section-divs --css=rust.css \
22-
--include-before-body=doc/version_info.html --include-in-header=doc/favicon.inc
23-
TEX_OPTS = $(BASE_DOC_OPTS) --include-before-body=doc/version.md --to=latex
20+
BASE_DOC_OPTS := --include-before-body=doc/version_info.html --standalone \
21+
--toc --number-sections
22+
HTML_OPTS = $(BASE_DOC_OPTS) --to=html5 --section-divs --css=rust.css \
23+
--include-in-header=doc/favicon.inc
24+
TEX_OPTS = $(BASE_DOC_OPTS) --to=latex
2425
EPUB_OPTS = $(BASE_DOC_OPTS) --to=epub
2526

2627
######################################################################
2728
# Rust version
2829
######################################################################
29-
3030
doc/version.md: $(MKFILE_DEPS) $(wildcard $(S)doc/*.*)
3131
@$(call E, version-stamp: $@)
3232
$(Q)echo "$(CFG_VERSION)" >$@
@@ -84,7 +84,7 @@ doc/rust.tex: rust.md doc/version.md
8484
$(CFG_PANDOC) $(TEX_OPTS) --output=$@
8585

8686
DOCS += doc/rust.epub
87-
doc/rust.epub: rust.md
87+
doc/rust.epub: rust.md doc/version_info.html doc/rust.css
8888
@$(call E, pandoc: $@)
8989
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
9090
$(CFG_PANDOC) $(EPUB_OPTS) --output=$@
@@ -114,7 +114,7 @@ doc/tutorial.tex: tutorial.md doc/version.md
114114
$(CFG_PANDOC) $(TEX_OPTS) --output=$@
115115

116116
DOCS += doc/tutorial.epub
117-
doc/tutorial.epub: tutorial.md
117+
doc/tutorial.epub: tutorial.md doc/version_info.html doc/rust.css
118118
@$(call E, pandoc: $@)
119119
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
120120
$(CFG_PANDOC) $(EPUB_OPTS) --output=$@
@@ -265,7 +265,6 @@ endif # No pandoc / node
265265
######################################################################
266266
# LLnextgen (grammar analysis from refman)
267267
######################################################################
268-
269268
ifeq ($(CFG_LLNEXTGEN),)
270269
$(info cfg: no llnextgen found, omitting grammar-verification)
271270
else

trunk/mk/tests.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,10 +626,9 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
626626
--aux-base $$(S)src/test/auxiliary/ \
627627
--stage-id stage$(1)-$(2) \
628628
--target $(2) \
629-
--host $(3) \
630629
--adb-path=$(CFG_ADB) \
631630
--adb-test-dir=$(CFG_ADB_TEST_DIR) \
632-
--rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS)" \
631+
--rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) --target=$(2)" \
633632
$$(CTEST_TESTARGS)
634633

635634
CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)

0 commit comments

Comments
 (0)