Skip to content

Commit 81964af

Browse files
Merge pull request #464 from ehuss/grammar-fixes
Fix some grammar issues.
2 parents 2febdc5 + e19004b commit 81964af

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/items/generics.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
> &nbsp;&nbsp; ( _LifetimeParam_ `,` )<sup>\*</sup> _LifetimeParam_<sup>?</sup>
1313
>
1414
> _LifetimeParam_ :\
15-
> &nbsp;&nbsp; [_OuterAttribute_]<sup>?</sup> [LIFETIME_OR_LABEL] `:` [_LifetimeBounds_]<sup>?</sup>
15+
> &nbsp;&nbsp; [_OuterAttribute_]<sup>?</sup> [LIFETIME_OR_LABEL]&nbsp;( `:` [_LifetimeBounds_] )<sup>?</sup>
1616
>
1717
> _TypeParams_:\
18-
> &nbsp;&nbsp; ( _TypeParam_ `,` )<sup>\*</sup> _TypeParam_ <sup>?</sup>
18+
> &nbsp;&nbsp; ( _TypeParam_ `,` )<sup>\*</sup> _TypeParam_<sup>?</sup>
1919
>
2020
> _TypeParam_ :\
21-
> &nbsp;&nbsp; [_OuterAttribute_]<sup>?</sup> [IDENTIFIER] ( `:` [_TypeParamBounds_] )<sup>?</sup> ( `=` [_Type_] )<sup>?</sup>
21+
> &nbsp;&nbsp; [_OuterAttribute_]<sup>?</sup> [IDENTIFIER] ( `:` [_TypeParamBounds_]<sup>?</sup> )<sup>?</sup> ( `=` [_Type_] )<sup>?</sup>
2222
2323
Functions, type aliases, structs, enumerations, unions, traits and
2424
implementations may be *parameterized* by types and lifetimes. These parameters

src/items/traits.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
> _Trait_ :\
55
> &nbsp;&nbsp; `unsafe`<sup>?</sup> `trait` [IDENTIFIER]&nbsp;
66
> [_Generics_]<sup>?</sup>
7+
> ( `:` [_TypeParamBounds_]<sup>?</sup> )<sup>?</sup>
78
> [_WhereClause_]<sup>?</sup> `{`\
89
> &nbsp;&nbsp;&nbsp;&nbsp; _TraitItem_<sup>\*</sup>\
910
> &nbsp;&nbsp; `}`
@@ -40,10 +41,10 @@
4041
> &nbsp;&nbsp; ( [_Pattern_] `:` )<sup>?</sup> [_Type_]
4142
>
4243
> _TraitConst_ :\
43-
> &nbsp;&nbsp; `const` [IDENTIFIER] ( ( `:` [_Type_] ) ( `=` [_Expression_] )<sup>?</sup> )<sup>?</sup> `;`
44+
> &nbsp;&nbsp; `const` [IDENTIFIER] `:` [_Type_]&nbsp;( `=` [_Expression_] )<sup>?</sup> `;`
4445
>
4546
> _TraitType_ :\
46-
> &nbsp;&nbsp; `type` [IDENTIFIER] ( `:` [_TypeParamBounds_] )<sup>?</sup> `;`
47+
> &nbsp;&nbsp; `type` [IDENTIFIER] ( `:` [_TypeParamBounds_]<sup>?</sup> )<sup>?</sup> `;`
4748
4849
A _trait_ describes an abstract interface that types can implement. This
4950
interface consists of [associated items], which come in three varieties:

src/items/use-declarations.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
> **<sup>Syntax:</sup>**\
44
> _UseDeclaration_ :\
5-
> &nbsp;&nbsp; [_Visibility_]<sup>?</sup> `use` _UseTree_ `;`
5+
> &nbsp;&nbsp; `use` _UseTree_ `;`
66
>
77
> _UseTree_ :\
88
> &nbsp;&nbsp; &nbsp;&nbsp; ([_SimplePath_]<sup>?</sup> `::`)<sup>?</sup> `*`\
99
> &nbsp;&nbsp; | ([_SimplePath_]<sup>?</sup> `::`)<sup>?</sup> `{` (_UseTree_ ( `,` _UseTree_ )<sup>\*</sup> `,`<sup>?</sup>)<sup>?</sup> `}`\
10-
> &nbsp;&nbsp; | [_SimplePath_] `as` [IDENTIFIER]
10+
> &nbsp;&nbsp; | [_SimplePath_]&nbsp;( `as` [IDENTIFIER] )<sup>?</sup>
1111
1212
A _use declaration_ creates one or more local name bindings synonymous with
1313
some other [path]. Usually a `use` declaration is used to shorten the path
@@ -152,5 +152,4 @@ fn main() {}
152152
153153
[IDENTIFIER]: identifiers.html
154154
[_SimplePath_]: paths.html#simple-paths
155-
[_Visibility_]: visibility-and-privacy.html
156155
[path qualifiers]: paths.html#path-qualifiers

0 commit comments

Comments
 (0)