Skip to content

Commit 4e67407

Browse files
committed
docs: fix fallout of merging ast::ViewItem into ast::Item.
1 parent f300582 commit 4e67407

File tree

1 file changed

+9
-23
lines changed

1 file changed

+9
-23
lines changed

src/doc/reference.md

+9-23
Original file line numberDiff line numberDiff line change
@@ -802,8 +802,9 @@ Crates contain [items](#items), each of which may have some number of
802802
## Items
803803

804804
```{.ebnf .gram}
805-
item : mod_item | fn_item | type_item | struct_item | enum_item
806-
| static_item | trait_item | impl_item | extern_block ;
805+
item : extern_crate_decl | use_decl | mod_item | fn_item | type_item
806+
| struct_item | enum_item | static_item | trait_item | impl_item
807+
| extern_block ;
807808
```
808809

809810
An _item_ is a component of a crate; some module items can be defined in crate
@@ -817,6 +818,8 @@ execution, and may reside in read-only memory.
817818

818819
There are several kinds of item:
819820

821+
* [`extern crate` declarations](#extern-crate-declarations)
822+
* [`use` declarations](#use-declarations)
820823
* [modules](#modules)
821824
* [functions](#functions)
822825
* [type definitions](#type-definitions)
@@ -853,13 +856,10 @@ no notion of type abstraction: there are no first-class "forall" types.
853856

854857
```{.ebnf .gram}
855858
mod_item : "mod" ident ( ';' | '{' mod '}' );
856-
mod : [ view_item | item ] * ;
859+
mod : item * ;
857860
```
858861

859-
A module is a container for zero or more [view items](#view-items) and zero or
860-
more [items](#items). The view items manage the visibility of the items defined
861-
within the module, as well as the visibility of names from outside the module
862-
when referenced from inside the module.
862+
A module is a container for zero or more [items](#items).
863863

864864
A _module item_ is a module, surrounded in braces, named, and prefixed with the
865865
keyword `mod`. A module item introduces a new, named module into the tree of
@@ -917,19 +917,6 @@ mod thread {
917917
}
918918
```
919919

920-
#### View items
921-
922-
```{.ebnf .gram}
923-
view_item : extern_crate_decl | use_decl ;
924-
```
925-
926-
A view item manages the namespace of a module. View items do not define new
927-
items, but rather, simply change other items' visibility. There are two
928-
kinds of view items:
929-
930-
* [`extern crate` declarations](#extern-crate-declarations)
931-
* [`use` declarations](#use-declarations)
932-
933920
##### Extern crate declarations
934921

935922
```{.ebnf .gram}
@@ -2854,13 +2841,12 @@ Point3d {y: 0, z: 10, .. base};
28542841
### Block expressions
28552842

28562843
```{.ebnf .gram}
2857-
block_expr : '{' [ view_item ] *
2858-
[ stmt ';' | item ] *
2844+
block_expr : '{' [ stmt ';' | item ] *
28592845
[ expr ] '}' ;
28602846
```
28612847

28622848
A _block expression_ is similar to a module in terms of the declarations that
2863-
are possible. Each block conceptually introduces a new namespace scope. View
2849+
are possible. Each block conceptually introduces a new namespace scope. Use
28642850
items can bring new names into scopes and declared items are in scope for only
28652851
the block itself.
28662852

0 commit comments

Comments
 (0)