Skip to content

Commit df6601b

Browse files
committed
---
yaml --- r: 42079 b: refs/heads/master c: 88bec09 h: refs/heads/master i: 42077: f8d2657 42075: a73fd85 42071: b451915 42063: 504e43e 42047: f810075 v: v3
1 parent f678a96 commit df6601b

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
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: bb51a8442fb16d71faccac1abfa953d8b1e37cb7
2+
refs/heads/master: 88bec09e6345d64d334c6dc1ef4947b35c467373
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
55
refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650

trunk/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ then
516516
| cut -d ' ' -f 2)
517517

518518
case $CFG_CLANG_VERSION in
519-
(3.0svn | 3.0 | 3.1* | 3.2* | 4.0* | 4.1*)
519+
(3.0svn | 3.0 | 3.1 | 3.2 | 4.0 | 4.1)
520520
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
521521
CFG_C_COMPILER="clang"
522522
;;

trunk/doc/tutorial.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,7 +2015,7 @@ the method name with the trait name.
20152015
The compiler will use type inference to decide which implementation to call.
20162016

20172017
~~~~
2018-
# trait Shape { static fn new(area: float) -> self; }
2018+
trait Shape { static fn new(area: float) -> self; }
20192019
# use float::consts::pi;
20202020
# use float::sqrt;
20212021
struct Circle { radius: float }
@@ -2211,11 +2211,16 @@ Likewise, supertrait methods may also be called on trait objects.
22112211
~~~ {.xfail-test}
22122212
# trait Shape { fn area(&self) -> float; }
22132213
# trait Circle : Shape { fn radius(&self) -> float; }
2214-
# impl int: Shape { fn area(&self) -> float { 0.0 } }
2215-
# impl int: Circle { fn radius(&self) -> float { 0.0 } }
2216-
# let mycircle = 0;
2214+
# use float::consts::pi;
2215+
# use float::sqrt;
2216+
# struct Point { x: float, y: float }
2217+
# struct CircleStruct { center: Point, radius: float }
2218+
# impl CircleStruct: Circle { fn radius(&self) -> float { sqrt(self.area() / pi) } }
2219+
# impl CircleStruct: Shape { fn area(&self) -> float { pi * square(self.radius) } }
2220+
2221+
let concrete = @CircleStruct{center:Point{x:3f,y:4f},radius:5f};
22172222
2218-
let mycircle: Circle = @mycircle as @Circle;
2223+
let mycircle: Circle = concrete as @Circle;
22192224
let nonsense = mycircle.radius() * mycircle.area();
22202225
~~~
22212226

0 commit comments

Comments
 (0)