File tree 2 files changed +19
-13
lines changed
2 files changed +19
-13
lines changed Original file line number Diff line number Diff line change 2
2
3
3
> ** <sup >Syntax:<sup >** \
4
4
> _ Item_ :\
5
- >   ;  ; [ _ OuterAttribute_ ] <sup >\* </sup > [ _ Visibility_ ] <sup >?</sup >\
5
+ >   ;  ; [ _ OuterAttribute_ ] <sup >\* </sup >\
6
+ >   ;  ;   ;  ; _ VisItem_ \
7
+ >   ;  ; | _ MacroItem_
8
+ >
9
+ > _ VisItem_ :\
10
+ >   ;  ; [ _ Visibility_ ] <sup >?</sup >\
6
11
>   ;  ; (\
7
12
>   ;  ;   ;  ;   ;  ; [ _ Module_ ] \
8
13
>   ;  ;   ;  ; | [ _ ExternCrate_ ] \
17
22
>   ;  ;   ;  ; | [ _ Trait_ ] \
18
23
>   ;  ;   ;  ; | [ _ Implementation_ ] \
19
24
>   ;  ;   ;  ; | [ _ ExternBlock_ ] \
20
- >   ;  ;   ;  ; | [ _ MacroInvocationSemi_ ]   ; [ ^ novis ] \
21
- >   ;  ;   ;  ; | [ _ MacroRulesDefinition_ ]   ; [ ^ novis ] \
22
25
>   ;  ; )
26
+ >
27
+ > _ MacroItem_ :\
28
+ >   ;  ;   ;  ; [ _ MacroInvocationSemi_ ] \
29
+ >   ;  ; | [ _ MacroRulesDefinition_ ]
30
+
23
31
24
32
An _ item_ is a component of a crate. Items are organized within a crate by a
25
33
nested set of [ modules] . Every crate has a single "outermost" anonymous module;
@@ -55,8 +63,6 @@ qualified by the name of the enclosing item, or is private to the enclosing
55
63
item (in the case of functions). The grammar specifies the exact locations in
56
64
which sub-item declarations may appear.
57
65
58
- [ ^ novis ] : Macros may not start with a visibility modifier.
59
-
60
66
[ _ConstantItem_ ] : items/constant-items.html
61
67
[ _Enumeration_ ] : items/enumerations.html
62
68
[ _ExternBlock_ ] : items/external-blocks.html
Original file line number Diff line number Diff line change 11
11
>   ;  ; ` } `
12
12
>
13
13
> _ InherentImplItem_ :\
14
- >   ;  ; [ _ OuterAttribute_ ] <sup >\* </sup >\
15
- >   ;  ; [ _ Visibility_ ] <sup >?</sup >\
16
- >   ;  ; ( [ _ ConstantItem_ ] | [ _ Function_ ] | [ _ Method_ ] | [ _ MacroInvocationSemi_ ]   ; [ ^ novis ] )
14
+ >   ;  ; [ _ OuterAttribute_ ] <sup >\* </sup > (\
15
+ >   ;  ;   ;  ;   ;  ; [ _ MacroInvocationSemi_ ] \
16
+ >   ;  ;   ;  ; | ( [ _ Visibility_ ] <sup >?</sup > ( [ _ ConstantItem_ ] | [ _ Function_ ] | [ _ Method_ ] ) )\
17
+ >   ;  ; )
17
18
>
18
19
> _ TraitImpl_ :\
19
20
>   ;  ; ` unsafe ` <sup >?</sup > ` impl ` [ _ Generics_ ] ` ! ` <sup >?</sup >
25
26
>   ;  ; ` } `
26
27
>
27
28
> _ TraitImplItem_ :\
28
- >   ;  ; [ _ OuterAttribute_ ] <sup >\* </sup >\
29
- >   ;  ; [ _ Visibility_ ] <sup >?</sup >\
30
- >   ;  ; ( [ _ TypeAlias_ ] | [ _ ConstantItem_ ] | [ _ Function_ ] | [ _ Method_ ] | [ _ MacroInvocationSemi_ ]   ; [ ^ novis ] )
29
+ >   ;  ; [ _ OuterAttribute_ ] <sup >\* </sup > (\
30
+ >   ;  ;   ;  ;   ;  ; [ _ MacroInvocationSemi_ ] \
31
+ >   ;  ;   ;  ; | ( [ _ Visibility_ ] <sup >?</sup > ( [ _ TypeAlias_ ] | [ _ ConstantItem_ ] | [ _ Function_ ] | [ _ Method_ ] ) )\
32
+ >   ;  ; )
31
33
32
34
An _ implementation_ is an item that associates items with an _ implementing type_ .
33
35
Implementations are defined with the keyword ` impl ` and contain functions
@@ -175,8 +177,6 @@ attributes must come before any associated items. That attributes that have
175
177
meaning here are [ ` cfg ` ] , [ ` deprecated ` ] , [ ` doc ` ] , and [ the lint check
176
178
attributes] .
177
179
178
- [ ^ novis ] : Macro invocations may not start with a visibility modifier.
179
-
180
180
[ IDENTIFIER ] : identifiers.html
181
181
[ _ConstantItem_ ] : items/constant-items.html
182
182
[ _Function_ ] : items/functions.html
You can’t perform that action at this time.
0 commit comments