Skip to content

Commit f3a39ab

Browse files
committed
---
yaml --- r: 22634 b: refs/heads/master c: 0f34144 h: refs/heads/master v: v3
1 parent aa9eae3 commit f3a39ab

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
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: 4843339d21f0c60b54d2a8f796243de90b1041b8
2+
refs/heads/master: 0f34144be308d28260d2496104ad06c2cb9cf5c3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/doc/tutorial.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2504,6 +2504,22 @@ needed because it could also, for example, specify an implementation
25042504
of `seq<int>`—the `of` clause *refers* to a type, rather than defining
25052505
one.
25062506

2507+
Note that functions do not explicitly have the type parameters that
2508+
are provided by the iface. It will cause a compile-time error if you
2509+
include them in the iface or impl.
2510+
2511+
## Use of the type `self` in interfaces
2512+
2513+
Interfaces may use `self` as a type where the implementation uses its
2514+
own type. This defines an interface for testing equality of a type with
2515+
itself:
2516+
2517+
~~~~
2518+
iface eq {
2519+
fn equals(other: self) -> bool;
2520+
}
2521+
~~~~
2522+
25072523
## Casting to an interface type
25082524

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

0 commit comments

Comments
 (0)