File tree Expand file tree Collapse file tree 2 files changed +19
-13
lines changed Expand file tree Collapse file tree 2 files changed +19
-13
lines changed Original file line number Diff line number Diff line change 22
33> ** <sup >Syntax:<sup >** \
44> _ Item_ :\
5- >   ;  ; [ _ OuterAttribute_ ] <sup >\* </sup > [ _ Visibility_ ] <sup >?</sup >\
5+ >   ;  ; [ _ OuterAttribute_ ] <sup >\* </sup >\
6+ >   ;  ;   ;  ; _ VisItem_ \
7+ >   ;  ; | _ MacroItem_
8+ >
9+ > _ VisItem_ :\
10+ >   ;  ; [ _ Visibility_ ] <sup >?</sup >\
611>   ;  ; (\
712>   ;  ;   ;  ;   ;  ; [ _ Module_ ] \
813>   ;  ;   ;  ; | [ _ ExternCrate_ ] \
1722>   ;  ;   ;  ; | [ _ Trait_ ] \
1823>   ;  ;   ;  ; | [ _ Implementation_ ] \
1924>   ;  ;   ;  ; | [ _ ExternBlock_ ] \
20- >   ;  ;   ;  ; | [ _ MacroInvocationSemi_ ]   ; [ ^ novis ] \
21- >   ;  ;   ;  ; | [ _ MacroRulesDefinition_ ]   ; [ ^ novis ] \
2225>   ;  ; )
26+ >
27+ > _ MacroItem_ :\
28+ >   ;  ;   ;  ; [ _ MacroInvocationSemi_ ] \
29+ >   ;  ; | [ _ MacroRulesDefinition_ ]
30+
2331
2432An _ item_ is a component of a crate. Items are organized within a crate by a
2533nested 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
5563item (in the case of functions). The grammar specifies the exact locations in
5664which sub-item declarations may appear.
5765
58- [ ^ novis ] : Macros may not start with a visibility modifier.
59-
6066[ _ConstantItem_ ] : items/constant-items.html
6167[ _Enumeration_ ] : items/enumerations.html
6268[ _ExternBlock_ ] : items/external-blocks.html
Original file line number Diff line number Diff line change 1111>   ;  ; ` } `
1212>
1313> _ 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+ >   ;  ; )
1718>
1819> _ TraitImpl_ :\
1920>   ;  ; ` unsafe ` <sup >?</sup > ` impl ` [ _ Generics_ ] ` ! ` <sup >?</sup >
2526>   ;  ; ` } `
2627>
2728> _ 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+ >   ;  ; )
3133
3234An _ implementation_ is an item that associates items with an _ implementing type_ .
3335Implementations are defined with the keyword ` impl ` and contain functions
@@ -175,8 +177,6 @@ attributes must come before any associated items. That attributes that have
175177meaning here are [ ` cfg ` ] , [ ` deprecated ` ] , [ ` doc ` ] , and [ the lint check
176178attributes] .
177179
178- [ ^ novis ] : Macro invocations may not start with a visibility modifier.
179-
180180[ IDENTIFIER ] : identifiers.html
181181[ _ConstantItem_ ] : items/constant-items.html
182182[ _Function_ ] : items/functions.html
You can’t perform that action at this time.
0 commit comments