Skip to content

Commit 667c636

Browse files
committed
---
yaml --- r: 22645 b: refs/heads/master c: 1615afe h: refs/heads/master i: 22643: 28cc660 v: v3
1 parent deb5e6d commit 667c636

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
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: 3dc52da989dfa69a6d1abf908610e52c472f871f
2+
refs/heads/master: 1615afe7046d7fe9ba3f390a462aecdd96d374cb
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/doc/tutorial.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2518,19 +2518,17 @@ interface describes types that support an equality operation:
25182518

25192519
~~~~
25202520
iface eq {
2521-
fn equals(other: self) -> bool;
2521+
fn equals(&&other: self) -> bool;
25222522
}
2523-
~~~~
2524-
2525-
In an implementation for type `int`, the `equals` method takes an
2526-
`int` argument:
25272523
2528-
~~~~
25292524
impl of eq for int {
2530-
fn equals(other: int) { other == self }
2525+
fn equals(&&other: int) -> bool { other == self }
25312526
}
25322527
~~~~
25332528

2529+
Notice that `equals` takes an `int` argument, rather than a `self` argument, in
2530+
an implementation for type `int`.
2531+
25342532
## Casting to an interface type
25352533

25362534
The above allows us to define functions that polymorphically act on

0 commit comments

Comments
 (0)