Skip to content

Commit f64b096

Browse files
committed
---
yaml --- r: 23967 b: refs/heads/master c: da5033f h: refs/heads/master i: 23965: f9cd697 23963: 5c03230 23959: 025aabd 23951: c1e46cf 23935: 079d98f v: v3
1 parent 295feed commit f64b096

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
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: 864cca14ee00082f67bbf92b60802195ab1c4d38
2+
refs/heads/master: da5033f99193cda3c95f5518d9591faae1ce5e6a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/doc/tutorial-borrowed-ptr.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ fn compute_distance(p1: &point, p2: &point) -> float {
7070

7171
Now we can call `compute_distance()` in various ways:
7272

73-
~~~ {.xfail-test}
73+
~~~
7474
# type point = {x: float, y: float};
7575
# let on_the_stack : point = {x: 3.0, y: 4.0};
7676
# let shared_box : @point = @{x: 5.0, y: 1.0};
7777
# let unique_box : ~point = ~{x: 7.0, y: 9.0};
7878
# fn compute_distance(p1: &point, p2: &point) -> float { 0f }
79-
compute_distance(&on_the_stack, shared_box)
80-
compute_distance(shared_box, unique_box)
79+
compute_distance(&on_the_stack, shared_box);
80+
compute_distance(shared_box, unique_box);
8181
~~~
8282

8383
Here the `&` operator is used to take the address of the variable
@@ -147,21 +147,21 @@ type rectangle = {origin: point, size: size};
147147
Now again I can define rectangles in a few different ways:
148148

149149
~~~
150-
let rect_stack = &{origin: {x: 1, y: 2}, size: {w: 3, h: 4}};
151-
let rect_shared = @{origin: {x: 3, y: 4}, size: {w: 3, h: 4}};
152-
let rect_unique = ~{origin: {x: 5, y: 6}, size: {w: 3, h: 4}};
150+
let rect_stack = &{origin: {x: 1f, y: 2f}, size: {w: 3f, h: 4f}};
151+
let rect_shared = @{origin: {x: 3f, y: 4f}, size: {w: 3f, h: 4f}};
152+
let rect_unique = ~{origin: {x: 5f, y: 6f}, size: {w: 3f, h: 4f}};
153153
~~~
154154

155155
In each case I can use the `&` operator to extact out individual
156156
subcomponents. For example, I could write:
157157

158-
~~~ {.xfail-test}
158+
~~~
159159
# type point = {x: float, y: float};
160160
# type size = {w: float, h: float}; // as before
161161
# type rectangle = {origin: point, size: size};
162-
# let rect_stack = &{origin: {x: 1, y: 2}, size: {w: 3, h: 4}};
163-
# let rect_shared = @{origin: {x: 3, y: 4}, size: {w: 3, h: 4}};
164-
# let rect_unique = ~{origin: {x: 5, y: 6}, size: {w: 3, h: 4}};
162+
# let rect_stack = &{origin: {x: 1f, y: 2f}, size: {w: 3f, h: 4f}};
163+
# let rect_shared = @{origin: {x: 3f, y: 4f}, size: {w: 3f, h: 4f}};
164+
# let rect_unique = ~{origin: {x: 5f, y: 6f}, size: {w: 3f, h: 4f}};
165165
# fn compute_distance(p1: &point, p2: &point) -> float { 0f }
166166
compute_distance(&rect_stack.origin, &rect_shared.origin);
167167
~~~

0 commit comments

Comments
 (0)