Skip to content

Commit 1120733

Browse files
committed
---
yaml --- r: 139356 b: refs/heads/try2 c: 4de9a94 h: refs/heads/master v: v3
1 parent fe4b00b commit 1120733

File tree

384 files changed

+4443
-4078
lines changed

Some content is hidden

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

384 files changed

+4443
-4078
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: 969e8b76a184ce3083c7854a986baf3f279b5c81
8+
refs/heads/try2: 4de9a9440711724a88805847ab6f93336e24e157
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/AUTHORS.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Aydin Kim <[email protected]>
2121
2222
Ben Alpert <[email protected]>
2323
24+
Ben Kelly <[email protected]>
2425
Ben Striegel <[email protected]>
2526
Benjamin Herr <[email protected]>
2627
Benjamin Jackman <[email protected]>
@@ -44,9 +45,12 @@ Daniel Brooks <[email protected]>
4445
Daniel Luz <[email protected]>
4546
Daniel Micay <[email protected]>
4647
Daniel Patterson <[email protected]>
48+
Daniel Ursache Dogariu <[email protected]>
4749
Dave Herman <[email protected]>
4850
David Forsythe <[email protected]>
51+
David Klein <[email protected]>
4952
David Rajchenbach-Teller <[email protected]>
53+
Dimitri Krassovski <[email protected]>
5054
Donovan Preston <[email protected]>
5155
Drew Willcoxon <[email protected]>
5256
Elliott Slaughter <[email protected]>
@@ -66,6 +70,7 @@ Gonçalo Cabrita <[email protected]>
6670
Graham Fawcett <[email protected]>
6771
Grahame Bowland <[email protected]>
6872
Haitao Li <[email protected]>
73+
6974
Huon Wilson <[email protected]>
7075
Ian D. Bollinger <[email protected]>
7176
Ilyong Cho <[email protected]>
@@ -80,11 +85,14 @@ Jeff Balogh <[email protected]>
8085
Jeff Muizelaar <[email protected]>
8186
Jeff Olson <[email protected]>
8287
Jeffrey Yasskin <[email protected]>
88+
Jeong YunWon <[email protected]>
8389
Jens Nockert <[email protected]>
8490
Jesse Jones <[email protected]>
8591
Jesse Ruderman <[email protected]>
92+
Jihyun Yu <[email protected]>
8693
Jim Blandy <[email protected]>
8794
95+
J. J. Weber <[email protected]>
8896
Joe Pletcher <[email protected]>
8997
John Clements <[email protected]>
9098
Jon Morton <[email protected]>
@@ -99,6 +107,7 @@ Kevin Atkinson <[email protected]>
99107
Kevin Cantu <[email protected]>
100108
Kyeongwoon Lee <[email protected]>
101109
Laurent Bonnans <[email protected]>
110+
Lawrence Velázquez <[email protected]>
102111
Lennart Kudling <[email protected]>
103112
Lindsey Kuper <[email protected]>
104113
Luca Bruno <[email protected]>
@@ -112,7 +121,9 @@ Mark Vian <[email protected]>
112121
Martin DeMello <[email protected]>
113122
Marvin Löbel <[email protected]>
114123
Matt Brubeck <[email protected]>
124+
Matthew McPherrin <[email protected]>
115125
Matthew O'Connor <[email protected]>
126+
Matthijs Hofstra <[email protected]>
116127
Max Penet <[email protected]>
117128
Michael Arntzenius <[email protected]>
118129
Michael Bebenita <[email protected]>
@@ -121,6 +132,7 @@ Michael Sullivan <[email protected]>
121132
Mikko Perttunen <[email protected]>
122133
Nick Desaulniers <[email protected]>
123134
Niko Matsakis <[email protected]>
135+
Olivier Saut <[email protected]>
124136
Or Brostovski <[email protected]>
125137
Orphée Lafond-Lummis <[email protected]>
126138
Patrick Walton <[email protected]>
@@ -140,14 +152,17 @@ Roy Frostig <[email protected]>
140152
Ryan Scheel <[email protected]>
141153
Sean Stangl <[email protected]>
142154
Sebastian N. Fernandez <[email protected]>
155+
Seth Pink <[email protected]>
143156
Seo Sanghyeon <[email protected]>
157+
144158
Simon Barber-Dueck <[email protected]>
145159
Simon Sapin <[email protected]>
146160
startling <[email protected]>
147161
Stefan Plantikow <[email protected]>
148162
Steve Klabnik <[email protected]>
149163
Taras Shpot <[email protected]>
150164
Ted Horst <[email protected]>
165+
Thad Guidry <[email protected]>
151166
Tim Chevalier <[email protected]>
152167
Tim Taubert <[email protected]>
153168
@@ -161,5 +176,6 @@ Vincent Belliard <[email protected]>
161176
Wade Mealing <[email protected]>
162177
William Ting <[email protected]>
163178
Yasuhiro Fujii <[email protected]>
179+
Young-il Choi <[email protected]>
164180
Youngsoo Son <[email protected]>
165181
Zack Corr <[email protected]>

branches/try2/RELEASES.txt

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
11
Version 0.6 (March 2013)
22
---------------------------
33

4-
* ~2000 changes, numerous bugfixes
5-
6-
* TODO:
7-
* Ord/Cmp
8-
* Lifetime changes
9-
* Remove `static` keyword
10-
* Static method syntax
11-
* `as Trait`
12-
* `copy` removed, replaced with `Clone`?
13-
* More details for "Name resolution continues to be tweaked"?
4+
* ~2100 changes, numerous bugfixes
145

156
* Syntax changes
167
* The self type parameter in traits is now spelled `Self`
178
* The `self` parameter in trait and impl methods must now be explicitly
189
named (for example: `fn f(&self) { }`). Implicit self is deprecated.
10+
* Static methods no longer require the `static` keyword and instead
11+
are distinguished by the lack of a `self` parameter
1912
* Replaced the `Durable` trait with the `'static` lifetime
2013
* The old closure type syntax with the trailing sigil has been
2114
removed in favor of the more consistent leading sigil
2215
* `super` is a keyword, and may be prefixed to paths
2316
* Trait bounds are separated with `+` instead of whitespace
2417
* Traits are implemented with `impl Trait for Type`
2518
instead of `impl Type: Trait`
19+
* Lifetime syntax is now `&'l foo` instead of `&l/foo`
2620
* The `export` keyword has finally been removed
2721
* The `move` keyword has been removed (see "Semantic changes")
2822
* The interior mutability qualifier on vectors, `[mut T]`, has been
@@ -41,9 +35,11 @@ Version 0.6 (March 2013)
4135
* Pattern matching over vectors improved and expanded
4236
* `const` renamed to `static` to correspond to lifetime name,
4337
and make room for future `static mut` unsafe mutable globals.
44-
* Replaced `#[deriving_eq]` with `#[deriving(Eq)]`
38+
* Replaced `#[deriving_eq]` with `#[deriving(Eq)]`, etc.
4539
* `Clone` implementations can be automatically generated with
4640
`#[deriving(Clone)]`
41+
* Casts to traits must use a pointer sigil, e.g. `@foo as @Bar`
42+
instead of `foo as Bar`.
4743

4844
* Semantic changes
4945
* Types with owned pointers or custom destructors move by default,
@@ -54,7 +50,11 @@ Version 0.6 (March 2013)
5450
* () has size 0
5551
* The name of the main function can be customized using #[main]
5652
* The default type of an inferred closure is &fn instead of @fn
57-
* Name resolution continues to be tweaked
53+
* `use` statements may no longer be "chained" - they cannot import
54+
identifiers imported by previous `use` statements
55+
* `use` statements are crate relative, importing from the "top"
56+
of the crate by default. Paths may be prefixed with `super::`
57+
or `self::` to change the search behavior.
5858
* Method visibility is inherited from the implementation declaration
5959
* Structural records have been removed
6060
* Many more types can be used in static items, including enums
@@ -80,14 +80,15 @@ Version 0.6 (March 2013)
8080
* `std::deque` and `std::smallintmap` reimplemented as owned containers
8181
* `core::trie` added as a fast ordered map for integer keys
8282
* Set types added to `core::hashmap`, `core::trie` and `std::treemap`
83+
* `Ord` split into `Ord` and `TotalOrd`. `Ord` is still used to
84+
overload the comparison operators, whereas `TotalOrd` is used
85+
by certain container types
8386

84-
* Tools
87+
* Other
8588
* Replaced the 'cargo' package manager with 'rustpkg'
8689
* Added all-purpose 'rust' tool
8790
* `rustc --test` now supports benchmarks with the `#[bench]` attribute
88-
* rustc now attempts to offer spelling suggestions
89-
90-
* Misc
91+
* rustc now *attempts* to offer spelling suggestions
9192
* Improved support for ARM and Android
9293
* Preliminary MIPS backend
9394
* Improved foreign function ABI implementation for x86, x86_64

branches/try2/doc/rust.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,9 @@ td {
101101
#TOC ul {
102102
list-style: none;
103103
padding-left: 0px;
104+
}
105+
106+
/* Adjust list alignment so rustdoc indexes don't align with blockquotes */
107+
div.index ul {
108+
padding-left: 1em;
104109
}

branches/try2/doc/rust.md

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -441,11 +441,11 @@ expression context, the final namespace qualifier is omitted.
441441
Two examples of paths with type arguments:
442442

443443
~~~~
444-
# use std::oldmap;
444+
# use core::hashmap::linear::LinearMap;
445445
# fn f() {
446446
# fn id<T:Copy>(t: T) -> T { t }
447-
type t = oldmap::HashMap<int,~str>; // Type arguments used in a type expression
448-
let x = id::<int>(10); // Type arguments used in a call expression
447+
type t = LinearMap<int,~str>; // Type arguments used in a type expression
448+
let x = id::<int>(10); // Type arguments used in a call expression
449449
# }
450450
~~~~
451451

@@ -830,12 +830,12 @@ An example of re-exporting:
830830
~~~~
831831
# fn main() { }
832832
mod quux {
833+
pub use quux::foo::*;
834+
833835
pub mod foo {
834836
pub fn bar() { }
835837
pub fn baz() { }
836838
}
837-
838-
pub use quux::foo::*;
839839
}
840840
~~~~
841841

@@ -1116,7 +1116,7 @@ static bit2: uint = 1 << 1;
11161116
static bits: [uint, ..2] = [bit1, bit2];
11171117
static string: &'static str = "bitstring";
11181118
1119-
struct BitsNStrings {
1119+
struct BitsNStrings<'self> {
11201120
mybits: [uint, ..2],
11211121
mystring: &'self str
11221122
}
@@ -1671,6 +1671,10 @@ vec_elems : [expr [',' expr]*] | [expr ',' ".." expr]
16711671
A [_vector_](#vector-types) _expression_ is written by enclosing zero or
16721672
more comma-separated expressions of uniform type in square brackets.
16731673

1674+
In the `[expr ',' ".." expr]` form, the expression after the `".."`
1675+
must be a constant expression that can be evaluated at compile time, such
1676+
as a [literal](#literals) or a [static item](#static-items).
1677+
16741678
~~~~
16751679
[1, 2, 3, 4];
16761680
["a", "b", "c", "d"];
@@ -2004,8 +2008,8 @@ then the expression completes.
20042008
Some examples of call expressions:
20052009

20062010
~~~~
2007-
# fn add(x: int, y: int) -> int { 0 }
20082011
# use core::from_str::FromStr::from_str;
2012+
# fn add(x: int, y: int) -> int { 0 }
20092013
20102014
let x: int = add(1, 2);
20112015
let pi = from_str::<f32>("3.14");
@@ -2156,6 +2160,19 @@ do f |j| {
21562160
}
21572161
~~~~
21582162

2163+
In this example, both calls to the (binary) function `k` are equivalent:
2164+
2165+
~~~~
2166+
# fn k(x:int, f: &fn(int)) { }
2167+
# fn l(i: int) { }
2168+
2169+
k(3, |j| l(j));
2170+
2171+
do k(3) |j| {
2172+
l(j);
2173+
}
2174+
~~~~
2175+
21592176

21602177
### For expressions
21612178

@@ -2184,7 +2201,7 @@ and early boolean-valued returns from the `block` function,
21842201
such that the meaning of `break` and `loop` is preserved in a primitive loop
21852202
when rewritten as a `for` loop controlled by a higher order function.
21862203

2187-
An example a for loop:
2204+
An example of a for loop over the contents of a vector:
21882205

21892206
~~~~
21902207
# type foo = int;
@@ -2198,6 +2215,14 @@ for v.each |e| {
21982215
}
21992216
~~~~
22002217

2218+
An example of a for loop over a series of integers:
2219+
2220+
~~~~
2221+
# fn bar(b:uint) { }
2222+
for uint::range(0, 256) |i| {
2223+
bar(i);
2224+
}
2225+
~~~~
22012226

22022227
### If expressions
22032228

@@ -2474,6 +2499,7 @@ fail_unless!(b != "world");
24742499

24752500
The vector type constructor represents a homogeneous array of values of a given type.
24762501
A vector has a fixed size.
2502+
(Operations like `vec::push` operate solely on owned vectors.)
24772503
A vector type can be annotated with a _definite_ size,
24782504
written with a trailing asterisk and integer literal, such as `[int * 10]`.
24792505
Such a definite-sized vector type is a first-class type, since its size is known statically.
@@ -2484,6 +2510,10 @@ such as `&[T]`, `@[T]` or `~[T]`.
24842510
The kind of a vector type depends on the kind of its element type,
24852511
as with other simple structural types.
24862512

2513+
Expressions producing vectors of definite size cannot be evaluated in a
2514+
context expecting a vector of indefinite size; one must copy the
2515+
definite-sized vector contents into a distinct vector of indefinite size.
2516+
24872517
An example of a vector type and its use:
24882518

24892519
~~~~

branches/try2/doc/tutorial-borrowed-ptr.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ For example, we could write a subroutine like this:
485485

486486
~~~
487487
struct Point {x: float, y: float}
488-
fn get_x(p: &'r Point) -> &'r float { &p.x }
488+
fn get_x<'r>(p: &'r Point) -> &'r float { &p.x }
489489
~~~
490490

491491
Here, the function `get_x()` returns a pointer into the structure it
@@ -571,8 +571,8 @@ function:
571571
# Rectangle(Point, Size) // upper-left, dimensions
572572
# }
573573
# fn compute_area(shape: &Shape) -> float { 0f }
574-
fn select<T>(shape: &'r Shape, threshold: float,
575-
a: &'r T, b: &'r T) -> &'r T {
574+
fn select<'r, T>(shape: &'r Shape, threshold: float,
575+
a: &'r T, b: &'r T) -> &'r T {
576576
if compute_area(shape) > threshold {a} else {b}
577577
}
578578
~~~
@@ -591,12 +591,12 @@ example:
591591
# Rectangle(Point, Size) // upper-left, dimensions
592592
# }
593593
# fn compute_area(shape: &Shape) -> float { 0f }
594-
# fn select<T>(shape: &Shape, threshold: float,
595-
# a: &'r T, b: &'r T) -> &'r T {
594+
# fn select<'r, T>(shape: &Shape, threshold: float,
595+
# a: &'r T, b: &'r T) -> &'r T {
596596
# if compute_area(shape) > threshold {a} else {b}
597597
# }
598598
// -+ r
599-
fn select_based_on_unit_circle<T>( // |-+ B
599+
fn select_based_on_unit_circle<'r, T>( // |-+ B
600600
threshold: float, a: &'r T, b: &'r T) -> &'r T { // | |
601601
// | |
602602
let shape = Circle(Point {x: 0., y: 0.}, 1.); // | |
@@ -628,8 +628,8 @@ returned. Here is how the new `select()` might look:
628628
# Rectangle(Point, Size) // upper-left, dimensions
629629
# }
630630
# fn compute_area(shape: &Shape) -> float { 0f }
631-
fn select<T>(shape: &'tmp Shape, threshold: float,
632-
a: &'r T, b: &'r T) -> &'r T {
631+
fn select<'r, 'tmp, T>(shape: &'tmp Shape, threshold: float,
632+
a: &'r T, b: &'r T) -> &'r T {
633633
if compute_area(shape) > threshold {a} else {b}
634634
}
635635
~~~
@@ -647,8 +647,8 @@ concise to just omit the named lifetime for `shape` altogether:
647647
# Rectangle(Point, Size) // upper-left, dimensions
648648
# }
649649
# fn compute_area(shape: &Shape) -> float { 0f }
650-
fn select<T>(shape: &Shape, threshold: float,
651-
a: &'r T, b: &'r T) -> &'r T {
650+
fn select<'r, T>(shape: &Shape, threshold: float,
651+
a: &'r T, b: &'r T) -> &'r T {
652652
if compute_area(shape) > threshold {a} else {b}
653653
}
654654
~~~

0 commit comments

Comments
 (0)