File tree 1 file changed +14
-2
lines changed
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -208,8 +208,8 @@ An *associated type declaration* declares a signature for associated type
208
208
definitions. It is written in one of the following forms, where ` Assoc ` is the
209
209
name of the associated type, ` Params ` is a comma-separated list of type,
210
210
lifetime or const parameters, ` Bounds ` is a plus-separated list of trait bounds
211
- on the associated type, and ` WhereBounds ` is a comma-separated list of bounds on
212
- parameters:
211
+ that the associated type must meet , and ` WhereBounds ` is a comma-separated list
212
+ of bounds that the parameters must meet :
213
213
214
214
<!-- ignore: illustrative example forms -->
215
215
``` rust,ignore
@@ -337,6 +337,18 @@ impl<T> Container for Vec<T> {
337
337
}
338
338
```
339
339
340
+ ### Relationship between ` Bounds ` and ` WhereBounds `
341
+
342
+ In this example:
343
+
344
+ ``` rust
345
+ trait Example {
346
+ type Output <T >: Ord where T : Debug ;
347
+ }
348
+ ```
349
+
350
+ Given a reference to the associated type like ` <X as Example>::Output<Y> ` , the associated type itself must be ` Ord ` , and the type ` Y ` must be ` Debug ` .
351
+
340
352
### Required where clauses on generic associated types
341
353
342
354
Generic associated type declarations on traits currently may require a list of
You can’t perform that action at this time.
0 commit comments