Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/items/generics.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ GenericParam -> OuterAttribute* ( LifetimeParam | TypeParam | ConstParam )
LifetimeParam -> Lifetime ( `:` LifetimeBounds )?
TypeParam -> IDENTIFIER ( `:` TypeParamBounds? )? ( `=` Type )?
TypeParam -> IDENTIFIER ( `:` Bounds? )? ( `=` Type )?
ConstParam ->
`const` IDENTIFIER `:` Type
Expand Down Expand Up @@ -236,7 +236,7 @@ WhereClauseItem ->
LifetimeWhereClauseItem -> Lifetime `:` LifetimeBounds
TypeBoundWhereClauseItem -> ForLifetimes? Type `:` TypeParamBounds?
TypeBoundWhereClauseItem -> ForLifetimes? Type `:` Bounds?
```

r[items.generics.where.intro]
Expand Down
2 changes: 1 addition & 1 deletion src/items/traits.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ r[items.traits]
r[items.traits.syntax]
```grammar,items
Trait ->
`unsafe`? `trait` IDENTIFIER GenericParams? ( `:` TypeParamBounds? )? WhereClause?
`unsafe`? `trait` IDENTIFIER GenericParams? ( `:` Bounds? )? WhereClause?
`{`
InnerAttribute*
AssociatedItem*
Expand Down
8 changes: 4 additions & 4 deletions src/items/type-aliases.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ r[items.type]
r[items.type.syntax]
```grammar,items
TypeAlias ->
`type` IDENTIFIER GenericParams? ( `:` TypeParamBounds )?
`type` IDENTIFIER GenericParams? ( `:` Bounds )?
WhereClause?
( `=` Type WhereClause?)? `;`
```
Expand Down Expand Up @@ -33,13 +33,13 @@ let _ = TypeAlias(5); // Doesn't work
```

r[items.type.associated-type]
A type alias, when not used as an [associated type], must include a [Type][grammar-Type] and may not include [TypeParamBounds].
A type alias, when not used as an [associated type], must include a [Type][grammar-Type] and may not include [Bounds].

r[items.type.associated-trait]
A type alias, when used as an [associated type] in a [trait], must not include a [Type][grammar-Type] specification but may include [TypeParamBounds].
A type alias, when used as an [associated type] in a [trait], must not include a [Type][grammar-Type] specification but may include [Bounds].

r[items.type.associated-impl]
A type alias, when used as an [associated type] in a [trait impl], must include a [Type][grammar-Type] specification and may not include [TypeParamBounds].
A type alias, when used as an [associated type] in a [trait impl], must include a [Type][grammar-Type] specification and may not include [Bounds].

r[items.type.deprecated]
Where clauses before the equals sign on a type alias in a [trait impl] (like `type TypeAlias<T> where T: Foo = Bar<T>`) are deprecated. Where clauses after the equals sign (like `type TypeAlias<T> = Bar<T> where T: Foo`) are preferred.
Expand Down
4 changes: 2 additions & 2 deletions src/paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ GenericArgsBinding ->
IDENTIFIER GenericArgs? `=` Type

GenericArgsBounds ->
IDENTIFIER GenericArgs? `:` TypeParamBounds
IDENTIFIER GenericArgs? `:` Bounds
```

r[paths.expr.intro]
Expand Down Expand Up @@ -162,7 +162,7 @@ TypePathFnInputs -> Type (`,` Type)* `,`?
```

r[paths.type.intro]
Type paths are used within type definitions, trait bounds, type parameter bounds, and qualified paths.
Type paths are used within type definitions, trait bounds, and qualified paths.

r[paths.type.turbofish]
Although the `::` token is allowed before the generics arguments, it is not required because there is no ambiguity like there is in [PathInExpression].
Expand Down
4 changes: 2 additions & 2 deletions src/trait-bounds.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ r[bound]

r[bound.syntax]
```grammar,miscellaneous
TypeParamBounds -> TypeParamBound ( `+` TypeParamBound )* `+`?
Bounds -> Bound ( `+` Bound )* `+`?

TypeParamBound -> Lifetime | TraitBound | UseBound
Bound -> Lifetime | TraitBound | UseBound

TraitBound ->
( `?` | ForLifetimes )? TypePath
Expand Down
2 changes: 1 addition & 1 deletion src/types/impl-trait.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ r[type.impl-trait]

r[type.impl-trait.syntax]
```grammar,types
ImplTraitType -> `impl` TypeParamBounds
ImplTraitType -> `impl` Bounds

ImplTraitTypeOneBound -> `impl` TraitBound
```
Expand Down
2 changes: 1 addition & 1 deletion src/types/trait-object.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ r[type.trait-object]

r[type.trait-object.syntax]
```grammar,types
TraitObjectType -> `dyn`? TypeParamBounds
TraitObjectType -> `dyn`? Bounds
TraitObjectTypeOneBound -> `dyn`? TraitBound
```
Expand Down
Loading