Skip to content

Commit c6bf370

Browse files
committed
---
yaml --- r: 159259 b: refs/heads/snap-stage3 c: 215f693 h: refs/heads/master i: 159257: ffa09d0 159255: 28eb564 v: v3
1 parent 56839dc commit c6bf370

File tree

518 files changed

+1411
-2376
lines changed

Some content is hidden

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

518 files changed

+1411
-2376
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 40fb87d40f681f5356af42175fc7b85da387f037
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: de05565ba31fb09b686d00f1b620ec1384136c42
4+
refs/heads/snap-stage3: 215f6934009a8e74e58441359482d8654c281009
55
refs/heads/try: f58aad6dce273570fb130b4df008ef9acd5a5be2
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10-
pub use self::Mode::*;
1110

1211
use std::fmt;
1312
use std::str::FromStr;

branches/snap-stage3/src/compiletest/compiletest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
#![crate_type = "bin"]
12-
#![feature(phase, slicing_syntax, globs)]
12+
#![feature(phase, slicing_syntax)]
1313

1414
#![deny(warnings)]
1515

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10-
#[cfg(not(stage0))]
11-
use self::TargetLocation::*;
1210

1311
use common::Config;
1412
use common::{CompileFail, Pretty, RunFail, RunPass, RunPassValgrind, DebugInfoGdb};

branches/snap-stage3/src/doc/guide-lifetimes.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ copying.
308308
# }
309309
fn compute_area(shape: &Shape) -> f64 {
310310
match *shape {
311-
Shape::Circle(_, radius) => std::f64::consts::PI * radius * radius,
312-
Shape::Rectangle(_, ref size) => size.w * size.h
311+
Circle(_, radius) => std::f64::consts::PI * radius * radius,
312+
Rectangle(_, ref size) => size.w * size.h
313313
}
314314
}
315315
~~~
@@ -478,14 +478,14 @@ example:
478478
# a: &'r T, b: &'r T) -> &'r T {
479479
# if compute_area(shape) > threshold {a} else {b}
480480
# }
481-
// -+ r
482-
fn select_based_on_unit_circle<'r, T>( // |-+ B
483-
threshold: f64, a: &'r T, b: &'r T) -> &'r T { // | |
484-
// | |
485-
let shape = Shape::Circle(Point {x: 0., y: 0.}, 1.); // | |
486-
select(&shape, threshold, a, b) // | |
487-
} // |-+
488-
// -+
481+
// -+ r
482+
fn select_based_on_unit_circle<'r, T>( // |-+ B
483+
threshold: f64, a: &'r T, b: &'r T) -> &'r T { // | |
484+
// | |
485+
let shape = Circle(Point {x: 0., y: 0.}, 1.); // | |
486+
select(&shape, threshold, a, b) // | |
487+
} // |-+
488+
// -+
489489
~~~
490490

491491
In this call to `select()`, the lifetime of the first parameter shape

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ doing nothing otherwise:
2222
~~~~
2323
# enum T { SpecialA(uint), SpecialB(uint) }
2424
# fn f() -> uint {
25-
# let input_1 = T::SpecialA(0);
26-
# let input_2 = T::SpecialA(0);
25+
# let input_1 = SpecialA(0);
26+
# let input_2 = SpecialA(0);
2727
match input_1 {
28-
T::SpecialA(x) => { return x; }
28+
SpecialA(x) => { return x; }
2929
_ => {}
3030
}
3131
// ...
3232
match input_2 {
33-
T::SpecialB(x) => { return x; }
33+
SpecialB(x) => { return x; }
3434
_ => {}
3535
}
3636
# return 0u;
@@ -49,20 +49,20 @@ the pattern in the above code:
4949
# #![feature(macro_rules)]
5050
# enum T { SpecialA(uint), SpecialB(uint) }
5151
# fn f() -> uint {
52-
# let input_1 = T::SpecialA(0);
53-
# let input_2 = T::SpecialA(0);
52+
# let input_1 = SpecialA(0);
53+
# let input_2 = SpecialA(0);
5454
macro_rules! early_return(
55-
($inp:expr $sp:path) => ( // invoke it like `(input_5 SpecialE)`
55+
($inp:expr $sp:ident) => ( // invoke it like `(input_5 SpecialE)`
5656
match $inp {
5757
$sp(x) => { return x; }
5858
_ => {}
5959
}
6060
);
6161
)
6262
// ...
63-
early_return!(input_1 T::SpecialA);
63+
early_return!(input_1 SpecialA);
6464
// ...
65-
early_return!(input_2 T::SpecialB);
65+
early_return!(input_2 SpecialB);
6666
# return 0;
6767
# }
6868
# fn main() {}
@@ -169,10 +169,10 @@ instead of `*` to mean "at least one".
169169
# #![feature(macro_rules)]
170170
# enum T { SpecialA(uint),SpecialB(uint),SpecialC(uint),SpecialD(uint)}
171171
# fn f() -> uint {
172-
# let input_1 = T::SpecialA(0);
173-
# let input_2 = T::SpecialA(0);
172+
# let input_1 = SpecialA(0);
173+
# let input_2 = SpecialA(0);
174174
macro_rules! early_return(
175-
($inp:expr, [ $($sp:path)|+ ]) => (
175+
($inp:expr, [ $($sp:ident)|+ ]) => (
176176
match $inp {
177177
$(
178178
$sp(x) => { return x; }
@@ -182,9 +182,9 @@ macro_rules! early_return(
182182
);
183183
)
184184
// ...
185-
early_return!(input_1, [T::SpecialA|T::SpecialC|T::SpecialD]);
185+
early_return!(input_1, [SpecialA|SpecialC|SpecialD]);
186186
// ...
187-
early_return!(input_2, [T::SpecialB]);
187+
early_return!(input_2, [SpecialB]);
188188
# return 0;
189189
# }
190190
# fn main() {}
@@ -234,9 +234,9 @@ Now consider code like the following:
234234
# enum T3 { Good2(uint), Bad2}
235235
# fn f(x: T1) -> uint {
236236
match x {
237-
T1::Good1(g1, val) => {
237+
Good1(g1, val) => {
238238
match g1.body {
239-
T3::Good2(result) => {
239+
Good2(result) => {
240240
// complicated stuff goes here
241241
return result + val;
242242
},
@@ -281,9 +281,9 @@ macro_rules! biased_match (
281281
# struct T2 { body: T3 }
282282
# enum T3 { Good2(uint), Bad2}
283283
# fn f(x: T1) -> uint {
284-
biased_match!((x) ~ (T1::Good1(g1, val)) else { return 0 };
284+
biased_match!((x) ~ (Good1(g1, val)) else { return 0 };
285285
binds g1, val )
286-
biased_match!((g1.body) ~ (T3::Good2(result) )
286+
biased_match!((g1.body) ~ (Good2(result) )
287287
else { panic!("Didn't get good_2") };
288288
binds result )
289289
// complicated stuff goes here
@@ -396,8 +396,8 @@ macro_rules! biased_match (
396396
# enum T3 { Good2(uint), Bad2}
397397
# fn f(x: T1) -> uint {
398398
biased_match!(
399-
(x) ~ (T1::Good1(g1, val)) else { return 0 };
400-
(g1.body) ~ (T3::Good2(result) ) else { panic!("Didn't get Good2") };
399+
(x) ~ (Good1(g1, val)) else { return 0 };
400+
(g1.body) ~ (Good2(result) ) else { panic!("Didn't get Good2") };
401401
binds val, result )
402402
// complicated stuff goes here
403403
return result + val;

branches/snap-stage3/src/doc/guide-pointers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ enum List<T> {
598598
}
599599
600600
fn main() {
601-
let list: List<int> = List::Cons(1, box List::Cons(2, box List::Cons(3, box List::Nil)));
601+
let list: List<int> = Cons(1, box Cons(2, box Cons(3, box Nil)));
602602
println!("{}", list);
603603
}
604604
```

branches/snap-stage3/src/doc/guide.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,17 +1263,17 @@ enum OptionalInt {
12631263
}
12641264
12651265
fn main() {
1266-
let x = OptionalInt::Value(5);
1267-
let y = OptionalInt::Missing;
1266+
let x = Value(5);
1267+
let y = Missing;
12681268
12691269
match x {
1270-
OptionalInt::Value(n) => println!("x is {}", n),
1271-
OptionalInt::Missing => println!("x is missing!"),
1270+
Value(n) => println!("x is {}", n),
1271+
Missing => println!("x is missing!"),
12721272
}
12731273
12741274
match y {
1275-
OptionalInt::Value(n) => println!("y is {}", n),
1276-
OptionalInt::Missing => println!("y is missing!"),
1275+
Value(n) => println!("y is {}", n),
1276+
Missing => println!("y is missing!"),
12771277
}
12781278
}
12791279
```
@@ -1702,17 +1702,17 @@ enum OptionalInt {
17021702
}
17031703
17041704
fn main() {
1705-
let x = OptionalInt::Value(5);
1706-
let y = OptionalInt::Missing;
1705+
let x = Value(5);
1706+
let y = Missing;
17071707
17081708
match x {
1709-
OptionalInt::Value(n) => println!("x is {}", n),
1710-
OptionalInt::Missing => println!("x is missing!"),
1709+
Value(n) => println!("x is {}", n),
1710+
Missing => println!("x is missing!"),
17111711
}
17121712
17131713
match y {
1714-
OptionalInt::Value(n) => println!("y is {}", n),
1715-
OptionalInt::Missing => println!("y is missing!"),
1714+
Value(n) => println!("y is {}", n),
1715+
Missing => println!("y is missing!"),
17161716
}
17171717
}
17181718
```
@@ -3709,7 +3709,7 @@ enum List {
37093709
}
37103710
37113711
fn main() {
3712-
let list = List::Node(0, box List::Node(1, box List::Nil));
3712+
let list = Node(0, box Node(1, box Nil));
37133713
}
37143714
```
37153715

@@ -3895,11 +3895,11 @@ enum OptionalInt {
38953895
Missing,
38963896
}
38973897
3898-
let x = OptionalInt::Value(5i);
3898+
let x = Value(5i);
38993899
39003900
match x {
3901-
OptionalInt::Value(..) => println!("Got an int!"),
3902-
OptionalInt::Missing => println!("No such luck."),
3901+
Value(..) => println!("Got an int!"),
3902+
Missing => println!("No such luck."),
39033903
}
39043904
```
39053905

@@ -3911,12 +3911,12 @@ enum OptionalInt {
39113911
Missing,
39123912
}
39133913
3914-
let x = OptionalInt::Value(5i);
3914+
let x = Value(5i);
39153915
39163916
match x {
3917-
OptionalInt::Value(i) if i > 5 => println!("Got an int bigger than five!"),
3918-
OptionalInt::Value(..) => println!("Got an int!"),
3919-
OptionalInt::Missing => println!("No such luck."),
3917+
Value(i) if i > 5 => println!("Got an int bigger than five!"),
3918+
Value(..) => println!("Got an int!"),
3919+
Missing => println!("No such luck."),
39203920
}
39213921
```
39223922

branches/snap-stage3/src/doc/reference.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,8 @@ r##"foo #"# bar"##; // foo #"# bar
304304
#### Byte and byte string literals
305305

306306
```{.ebnf .gram}
307-
byte_lit : "b\x27" byte_body '\x27' ;
308-
byte_string_lit : "b\x22" string_body * '\x22' | "br" raw_byte_string ;
307+
byte_lit : 'b' '\x27' byte_body '\x27' ;
308+
byte_string_lit : 'b' '"' string_body * '"' | 'b' 'r' raw_byte_string ;
309309
310310
byte_body : ascii_non_single_quote
311311
| '\x5c' [ '\x27' | common_escape ] ;
@@ -381,10 +381,10 @@ num_suffix : int_suffix | float_suffix ;
381381
382382
int_suffix : 'u' int_suffix_size ?
383383
| 'i' int_suffix_size ? ;
384-
int_suffix_size : [ '8' | "16" | "32" | "64" ] ;
384+
int_suffix_size : [ '8' | '1' '6' | '3' '2' | '6' '4' ] ;
385385
386386
float_suffix : [ exponent | '.' dec_lit exponent ? ] ? float_suffix_ty ? ;
387-
float_suffix_ty : 'f' [ "32" | "64" ] ;
387+
float_suffix_ty : 'f' [ '3' '2' | '6' '4' ] ;
388388
exponent : ['E' | 'e'] ['-' | '+' ] ? dec_lit ;
389389
dec_lit : [ dec_digit | '_' ] + ;
390390
```
@@ -1331,8 +1331,8 @@ enum Animal {
13311331
Cat
13321332
}
13331333
1334-
let mut a: Animal = Animal::Dog;
1335-
a = Animal::Cat;
1334+
let mut a: Animal = Dog;
1335+
a = Cat;
13361336
```
13371337

13381338
Enumeration constructors can have either named or unnamed fields:
@@ -1345,8 +1345,8 @@ enum Animal {
13451345
Cat { name: String, weight: f64 }
13461346
}
13471347
1348-
let mut a: Animal = Animal::Dog("Cocoa".to_string(), 37.2);
1349-
a = Animal::Cat { name: "Spotty".to_string(), weight: 2.7 };
1348+
let mut a: Animal = Dog("Cocoa".to_string(), 37.2);
1349+
a = Cat { name: "Spotty".to_string(), weight: 2.7 };
13501350
# }
13511351
```
13521352

@@ -1862,7 +1862,7 @@ the namespace hierarchy as it normally would.
18621862
## Attributes
18631863

18641864
```{.ebnf .gram}
1865-
attribute : "#!" ? '[' meta_item ']' ;
1865+
attribute : '#' '!' ? '[' meta_item ']' ;
18661866
meta_item : ident [ '=' literal
18671867
| '(' meta_seq ')' ] ? ;
18681868
meta_seq : meta_item [ ',' meta_seq ] ? ;
@@ -3308,12 +3308,12 @@ fields of a particular variant. For example:
33083308
```
33093309
enum List<X> { Nil, Cons(X, Box<List<X>>) }
33103310
3311-
let x: List<int> = List::Cons(10, box List::Cons(11, box List::Nil));
3311+
let x: List<int> = Cons(10, box Cons(11, box Nil));
33123312
33133313
match x {
3314-
List::Cons(_, box List::Nil) => panic!("singleton list"),
3315-
List::Cons(..) => return,
3316-
List::Nil => panic!("empty list")
3314+
Cons(_, box Nil) => panic!("singleton list"),
3315+
Cons(..) => return,
3316+
Nil => panic!("empty list")
33173317
}
33183318
```
33193319

@@ -3371,16 +3371,16 @@ An example of a `match` expression:
33713371
33723372
enum List<X> { Nil, Cons(X, Box<List<X>>) }
33733373
3374-
let x: List<int> = List::Cons(10, box List::Cons(11, box List::Nil));
3374+
let x: List<int> = Cons(10, box Cons(11, box Nil));
33753375
33763376
match x {
3377-
List::Cons(a, box List::Cons(b, _)) => {
3377+
Cons(a, box Cons(b, _)) => {
33783378
process_pair(a, b);
33793379
}
3380-
List::Cons(10, _) => {
3380+
Cons(10, _) => {
33813381
process_ten();
33823382
}
3383-
List::Nil => {
3383+
Nil => {
33843384
return;
33853385
}
33863386
_ => {
@@ -3402,18 +3402,18 @@ enum List { Nil, Cons(uint, Box<List>) }
34023402
34033403
fn is_sorted(list: &List) -> bool {
34043404
match *list {
3405-
List::Nil | List::Cons(_, box List::Nil) => true,
3406-
List::Cons(x, ref r @ box List::Cons(_, _)) => {
3405+
Nil | Cons(_, box Nil) => true,
3406+
Cons(x, ref r @ box Cons(_, _)) => {
34073407
match *r {
3408-
box List::Cons(y, _) => (x <= y) && is_sorted(&**r),
3408+
box Cons(y, _) => (x <= y) && is_sorted(&**r),
34093409
_ => panic!()
34103410
}
34113411
}
34123412
}
34133413
}
34143414
34153415
fn main() {
3416-
let a = List::Cons(6, box List::Cons(7, box List::Cons(42, box List::Nil)));
3416+
let a = Cons(6, box Cons(7, box Cons(42, box Nil)));
34173417
assert!(is_sorted(&a));
34183418
}
34193419
@@ -3718,7 +3718,7 @@ enum List<T> {
37183718
Cons(T, Box<List<T>>)
37193719
}
37203720
3721-
let a: List<int> = List::Cons(7, box List::Cons(13, box List::Nil));
3721+
let a: List<int> = Cons(7, box Cons(13, box Nil));
37223722
```
37233723

37243724
### Pointer types

0 commit comments

Comments
 (0)