Skip to content

Commit 148951c

Browse files
committed
---
yaml --- r: 109951 b: refs/heads/master c: dab5de2 h: refs/heads/master i: 109949: 9ef76c6 109947: 550dc24 109943: 9c198be 109935: 9e8e0ee 109919: 4df4afd 109887: 1748532 109823: 0444d12 v: v3
1 parent 4830935 commit 148951c

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
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: 51ea4fb17f8a6c37220b971dd8c7f343f9fdcea2
2+
refs/heads/master: dab5de268dfa0fa7f1cfcb3f2a0a99287acec25f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: c7fac4471201977fdb1c0c0a26c87287e12dc644
55
refs/heads/try: f64fdf524a434f0e5cd0bc91d09c144723f3c90d

trunk/src/doc/tutorial.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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,7 +1907,6 @@ to a reference.
19071907
// As with typical function arguments, owned pointers
19081908
// are automatically converted to references
19091909

1910-
(@s).draw_reference();
19111910
(~s).draw_reference();
19121911

19131912
// Unlike typical function arguments, the self value will
@@ -1918,7 +1917,7 @@ s.draw_reference();
19181917
(& &s).draw_reference();
19191918

19201919
// ... and dereferenced and borrowed
1921-
(&@~s).draw_reference();
1920+
(&~s).draw_reference();
19221921
~~~
19231922
19241923
Implementations may also define standalone (sometimes called "static")
@@ -2403,7 +2402,7 @@ that, like strings and vectors, objects have dynamic size and may
24032402
only be referred to via one of the pointer types.
24042403
Other pointer types work as well.
24052404
Casts to traits may only be done with compatible pointers so,
2406-
for example, an `@Circle` may not be cast to an `~Drawable`.
2405+
for example, an `&Circle` may not be cast to an `~Drawable`.
24072406
24082407
~~~
24092408
# type Circle = int; type Rectangle = int;
@@ -2506,8 +2505,8 @@ use std::f64::consts::PI;
25062505
# impl Circle for CircleStruct { fn radius(&self) -> f64 { (self.area() / PI).sqrt() } }
25072506
# impl Shape for CircleStruct { fn area(&self) -> f64 { PI * square(self.radius) } }
25082507
2509-
let concrete = @CircleStruct{center:Point{x:3.0,y:4.0},radius:5.0};
2510-
let mycircle: @Circle = concrete as @Circle;
2508+
let concrete = ~CircleStruct{center:Point{x:3.0,y:4.0},radius:5.0};
2509+
let mycircle: ~Circle = concrete as ~Circle;
25112510
let nonsense = mycircle.radius() * mycircle.area();
25122511
~~~
25132512

0 commit comments

Comments
 (0)