File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
5
5
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
- refs/heads/try2: 9cba4af24366b6c08299e709fac26361d7920ccb
8
+ refs/heads/try2: d81196ce96b1d3da7bb718ed4c5e9d4810be896e
9
9
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10
10
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
11
11
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
Original file line number Diff line number Diff line change @@ -1157,9 +1157,14 @@ The definition expression of a constant is limited to expression forms that can
1157
1157
1158
1158
### Traits
1159
1159
1160
- A _ trait item_ describes a set of method types. [ _ implementation
1161
- items_ ] ( #implementations ) can be used to provide implementations of
1162
- those methods for a specific type.
1160
+ A _ trait_ describes a set of method types.
1161
+
1162
+ Traits can include default implementations of methods,
1163
+ written in terms of some unknown [ ` self ` type] ( #self-types ) ;
1164
+ the ` self ` type may either be completely unspecified,
1165
+ or constrained by some other [ trait type] ( #trait-types ) .
1166
+
1167
+ Traits are implemented for specific types through separate [ implementations] ( #implementations ) .
1163
1168
1164
1169
~~~~
1165
1170
# type surface = int;
@@ -1171,10 +1176,9 @@ trait shape {
1171
1176
}
1172
1177
~~~~
1173
1178
1174
- This defines a trait with two methods. All values that have
1175
- [ implementations] ( #implementations ) of this trait in scope can
1176
- have their ` draw ` and ` bounding_box ` methods called, using
1177
- ` value.bounding_box() ` [ syntax] ( #field-expressions ) .
1179
+ This defines a trait with two methods.
1180
+ All values that have [ implementations] ( #implementations ) of this trait in scope can have their ` draw ` and ` bounding_box ` methods called,
1181
+ using ` value.bounding_box() ` [ syntax] ( #field-expressions ) .
1178
1182
1179
1183
Type parameters can be specified for a trait to make it generic.
1180
1184
These appear after the name, using the same syntax used in [ generic
You can’t perform that action at this time.
0 commit comments