File tree 1 file changed +15
-2
lines changed
1 file changed +15
-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,19 @@ 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
+ # use std :: fmt :: Debug ;
346
+ trait Example {
347
+ type Output <T >: Ord where T : Debug ;
348
+ }
349
+ ```
350
+
351
+ 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 ` .
352
+
340
353
### Required where clauses on generic associated types
341
354
342
355
Generic associated type declarations on traits currently may require a list of
You can’t perform that action at this time.
0 commit comments