Skip to content

Commit 66951b5

Browse files
committed
---
yaml --- r: 110171 b: refs/heads/auto c: d9a1af2 h: refs/heads/master i: 110169: f76f72c 110167: f04f801 v: v3
1 parent c08a74e commit 66951b5

File tree

13 files changed

+240
-148
lines changed

13 files changed

+240
-148
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 94a055c7295bd5822219b86243c2af6fff9d21d3
16+
refs/heads/auto: d9a1af27419d866500db00a204854d708553a320
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/doc/rust.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,13 @@ The keywords are the following strings:
206206
as
207207
break
208208
crate
209+
do
209210
else enum extern
210211
false fn for
211212
if impl in
212213
let loop
213214
match mod mut
214-
priv proc pub
215+
priv pub
215216
ref return
216217
self static struct super
217218
true trait type
@@ -2557,12 +2558,12 @@ task in a _failing state_.
25572558

25582559
~~~~ {.ignore}
25592560
# use std::task;
2560-
# task::spawn(proc() {
2561+
# do task::spawn {
25612562
25622563
([1, 2, 3, 4])[0];
25632564
(["a", "b"])[10]; // fails
25642565
2565-
# })
2566+
# }
25662567
~~~~
25672568

25682569
### Unary operator expressions

branches/auto/src/doc/rustdoc.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,12 @@ that one can still write things like `#[deriving(Eq)]`).
165165
# // what's actually being documented.
166166
# fn fib(n: int) { n + 2 }
167167

168-
spawn(proc() { fib(200); })
168+
do spawn { fib(200); }
169169
```
170170
*/
171171
# fn foo() {}
172172

173-
The documentation online would look like `spawn(proc() { fib(200); })`, but when
173+
The documentation online would look like `do spawn { fib(200); }`, but when
174174
testing this code, the `fib` function will be included (so it can compile).
175175

176176
## Running tests (advanced)

branches/auto/src/doc/tutorial.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,8 +1492,8 @@ Rust uses the unary star operator (`*`) to access the contents of a
14921492
box or pointer, similarly to C.
14931493
14941494
~~~
1495-
let owned = ~10;
1496-
let borrowed = &20;
1495+
let owned = ~20;
1496+
let borrowed = &30;
14971497

14981498
let sum = *owned + *borrowed;
14991499
~~~
@@ -1520,7 +1520,7 @@ can sometimes make code awkward and parenthesis-filled.
15201520
# struct Point { x: f64, y: f64 }
15211521
# enum Shape { Rectangle(Point, Point) }
15221522
# impl Shape { fn area(&self) -> int { 0 } }
1523-
let start = ~Point { x: 10.0, y: 20.0 };
1523+
let start = @Point { x: 10.0, y: 20.0 };
15241524
let end = ~Point { x: (*start).x + 100.0, y: (*start).y + 100.0 };
15251525
let rect = &Rectangle(*start, *end);
15261526
let area = (*rect).area();
@@ -1534,7 +1534,7 @@ dot), so in most cases, explicitly dereferencing the receiver is not necessary.
15341534
# struct Point { x: f64, y: f64 }
15351535
# enum Shape { Rectangle(Point, Point) }
15361536
# impl Shape { fn area(&self) -> int { 0 } }
1537-
let start = ~Point { x: 10.0, y: 20.0 };
1537+
let start = @Point { x: 10.0, y: 20.0 };
15381538
let end = ~Point { x: start.x + 100.0, y: start.y + 100.0 };
15391539
let rect = &Rectangle(*start, *end);
15401540
let area = rect.area();
@@ -1546,7 +1546,7 @@ something silly like
15461546
15471547
~~~
15481548
# struct Point { x: f64, y: f64 }
1549-
let point = &~Point { x: 10.0, y: 20.0 };
1549+
let point = &@~Point { x: 10.0, y: 20.0 };
15501550
println!("{:f}", point.x);
15511551
~~~
15521552
@@ -1907,6 +1907,7 @@ to a reference.
19071907
// As with typical function arguments, owned pointers
19081908
// are automatically converted to references
19091909

1910+
(@s).draw_reference();
19101911
(~s).draw_reference();
19111912

19121913
// Unlike typical function arguments, the self value will
@@ -1917,7 +1918,7 @@ s.draw_reference();
19171918
(& &s).draw_reference();
19181919

19191920
// ... and dereferenced and borrowed
1920-
(&~s).draw_reference();
1921+
(&@~s).draw_reference();
19211922
~~~
19221923
19231924
Implementations may also define standalone (sometimes called "static")
@@ -2402,7 +2403,7 @@ that, like strings and vectors, objects have dynamic size and may
24022403
only be referred to via one of the pointer types.
24032404
Other pointer types work as well.
24042405
Casts to traits may only be done with compatible pointers so,
2405-
for example, an `&Circle` may not be cast to an `~Drawable`.
2406+
for example, an `@Circle` may not be cast to an `~Drawable`.
24062407
24072408
~~~
24082409
# type Circle = int; type Rectangle = int;
@@ -2505,8 +2506,8 @@ use std::f64::consts::PI;
25052506
# impl Circle for CircleStruct { fn radius(&self) -> f64 { (self.area() / PI).sqrt() } }
25062507
# impl Shape for CircleStruct { fn area(&self) -> f64 { PI * square(self.radius) } }
25072508
2508-
let concrete = ~CircleStruct{center:Point{x:3.0,y:4.0},radius:5.0};
2509-
let mycircle: ~Circle = concrete as ~Circle;
2509+
let concrete = @CircleStruct{center:Point{x:3.0,y:4.0},radius:5.0};
2510+
let mycircle: @Circle = concrete as @Circle;
25102511
let nonsense = mycircle.radius() * mycircle.area();
25112512
~~~
25122513

branches/auto/src/librustc/driver/driver.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,6 @@ pub fn phase_3_run_analysis_passes(sess: Session,
323323
let region_map = time(time_passes, "region resolution", (), |_|
324324
middle::region::resolve_crate(&sess, krate));
325325

326-
time(time_passes, "loop checking", (), |_|
327-
middle::check_loop::check_crate(&sess, krate));
328-
329326
let ty_cx = ty::mk_ctxt(sess, def_map, named_region_map, ast_map,
330327
freevars, region_map, lang_items);
331328

@@ -351,6 +348,9 @@ pub fn phase_3_run_analysis_passes(sess: Session,
351348
time(time_passes, "effect checking", (), |_|
352349
middle::effect::check_crate(&ty_cx, method_map, krate));
353350

351+
time(time_passes, "loop checking", (), |_|
352+
middle::check_loop::check_crate(&ty_cx, krate));
353+
354354
let middle::moves::MoveMaps {moves_map, moved_variables_set,
355355
capture_map} =
356356
time(time_passes, "compute moves", (), |_|

branches/auto/src/librustc/middle/check_loop.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use driver::session::Session;
11+
use middle::ty;
1212

1313
use syntax::ast;
1414
use syntax::codemap::Span;
@@ -21,11 +21,11 @@ enum Context {
2121
}
2222

2323
struct CheckLoopVisitor<'a> {
24-
sess: &'a Session,
24+
tcx: &'a ty::ctxt,
2525
}
2626

27-
pub fn check_crate(sess: &Session, krate: &ast::Crate) {
28-
visit::walk_crate(&mut CheckLoopVisitor { sess: sess }, krate, Normal)
27+
pub fn check_crate(tcx: &ty::ctxt, krate: &ast::Crate) {
28+
visit::walk_crate(&mut CheckLoopVisitor { tcx: tcx }, krate, Normal)
2929
}
3030

3131
impl<'a> Visitor<Context> for CheckLoopVisitor<'a> {
@@ -57,10 +57,12 @@ impl<'a> CheckLoopVisitor<'a> {
5757
match cx {
5858
Loop => {}
5959
Closure => {
60-
self.sess.span_err(span, format!("`{}` inside of a closure", name));
60+
self.tcx.sess.span_err(span, format!("`{}` inside of a closure",
61+
name));
6162
}
6263
Normal => {
63-
self.sess.span_err(span, format!("`{}` outside of loop", name));
64+
self.tcx.sess.span_err(span, format!("`{}` outside of loop",
65+
name));
6466
}
6567
}
6668
}

branches/auto/src/librustc/middle/typeck/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ fn compare_impl_method(tcx: &ty::ctxt,
923923
result::Err(ref terr) => {
924924
tcx.sess.span_err(
925925
impl_m_span,
926-
format!("method `{}` has an incompatible type for trait: {}",
926+
format!("method `{}` has an incompatible type: {}",
927927
token::get_ident(trait_m.ident),
928928
ty::type_err_to_str(tcx, terr)));
929929
ty::note_and_explain_type_err(tcx, terr);

branches/auto/src/libsemver/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,17 @@ impl fmt::Show for Identifier {
7979
#[deriving(Clone)]
8080
pub struct Version {
8181
/// The major version, to be incremented on incompatible changes.
82-
major: uint,
82+
pub major: uint,
8383
/// The minor version, to be incremented when functionality is added in a
8484
/// backwards-compatible manner.
85-
minor: uint,
85+
pub minor: uint,
8686
/// The patch version, to be incremented when backwards-compatible bug
8787
/// fixes are made.
88-
patch: uint,
88+
pub patch: uint,
8989
/// The pre-release version identifier, if one exists.
90-
pre: Vec<Identifier>,
90+
pub pre: Vec<Identifier>,
9191
/// The build metadata, ignored when determining version precedence.
92-
build: Vec<Identifier>,
92+
pub build: Vec<Identifier>,
9393
}
9494

9595
impl fmt::Show for Version {

0 commit comments

Comments
 (0)