Skip to content

Commit e32a1a8

Browse files
committed
Clarify ATBs in syntax index
On the branch, we had an entry in the expressions table for `Type<ident=Type>`. This was notated as "explicit associated type bounds" and referenced a TODO item about default type parameters not being documented. Perhaps what this means to describe are associated type bindings and associated type bounds. Let's document those in the type expressions table. We'll remove the TODO note, as it's not relevant to this.
1 parent 256eb2f commit e32a1a8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/syntax-index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ This appendix provides an index of tokens and common forms with links to where t
175175
| `Trait::method(…)`<br>`Type::method(…)`<br>`<Type as Trait>::method(…)` | [disambiguated method calls] |
176176
| `Type<…>` | [generic arguments] (e.g. `Vec<u8>`) <!-- TODO: fix after generic args reorg --> |
177177
| `method::<…>(…)`<br>`path::<…>` | [generic arguments], aka turbofish |
178-
| `Type<ident=Type>` | [explicit associated type bounds] (e.g. `Iterator<Item=T>`) <!-- undocumented https://github.com/rust-lang/reference/issues/24 --> |
179178
| `()` | [unit] |
180179
| `(expr)` | [parenthesized expressions] |
181180
| `(expr,)` | [single-element tuple expression] |
@@ -241,6 +240,8 @@ This appendix provides an index of tokens and common forms with links to where t
241240
| `impl Trait` | [impl trait types], [anonymous type parameters] |
242241
| `dyn Trait` | [trait object types] |
243242
| `ident`<br>`ident::…` | [type paths] (can refer to structs, enums, unions, aliases, traits, generics, etc.) |
243+
| `Trait<ident = Type>` | [associated type bindings] (e.g. `Iterator<Item = T>`) |
244+
| `Trait<ident: …>` | [associated type bounds] (e.g. `Iterator<Item: Send>`) |
244245
| `&Type`<br>`&mut Type` | [reference types] |
245246
| `*mut Type`<br>`*const Type` | [raw pointer types] |
246247
| `fn(…) -> Type` | [function pointer types] |
@@ -279,6 +280,8 @@ This appendix provides an index of tokens and common forms with links to where t
279280
[assembly operands]: asm.operand-type.supported-operands.in
280281
[assignment]: expr.assign
281282
[associated items]: items.associated
283+
[associated type bindings]: paths.expr
284+
[associated type bounds]: paths.expr
282285
[async blocks]: expr.block.async
283286
[async closures]: expr.closure.async
284287
[async functions]: items.fn.async
@@ -314,7 +317,6 @@ This appendix provides an index of tokens and common forms with links to where t
314317
[destructuring assignment]: expr.placeholder
315318
[disambiguated method calls]: expr.call.desugar
316319
[enumerations]: items.enum
317-
[explicit associated type bounds]: paths.expr
318320
[explicit crate paths]: paths.qualifiers.global-root
319321
[extern crate]: items.extern-crate
320322
[extern function pointer types]: type.fn-pointer.qualifiers

0 commit comments

Comments
 (0)