@@ -803,8 +803,9 @@ Crates contain [items](#items), each of which may have some number of
803803## Items
804804
805805``` {.ebnf .gram}
806- item : mod_item | fn_item | type_item | struct_item | enum_item
807- | static_item | trait_item | impl_item | extern_block ;
806+ item : extern_crate_decl | use_decl | mod_item | fn_item | type_item
807+ | struct_item | enum_item | static_item | trait_item | impl_item
808+ | extern_block ;
808809```
809810
810811An _ item_ is a component of a crate; some module items can be defined in crate
@@ -818,6 +819,8 @@ execution, and may reside in read-only memory.
818819
819820There are several kinds of item:
820821
822+ * [ ` extern crate ` declarations] ( #extern-crate-declarations )
823+ * [ ` use ` declarations] ( #use-declarations )
821824* [ modules] ( #modules )
822825* [ functions] ( #functions )
823826* [ type definitions] ( #type-definitions )
@@ -854,13 +857,10 @@ no notion of type abstraction: there are no first-class "forall" types.
854857
855858``` {.ebnf .gram}
856859mod_item : "mod" ident ( ';' | '{' mod '}' );
857- mod : [ view_item | item ] * ;
860+ mod : item * ;
858861```
859862
860- A module is a container for zero or more [ view items] ( #view-items ) and zero or
861- more [ items] ( #items ) . The view items manage the visibility of the items defined
862- within the module, as well as the visibility of names from outside the module
863- when referenced from inside the module.
863+ A module is a container for zero or more [ items] ( #items ) .
864864
865865A _ module item_ is a module, surrounded in braces, named, and prefixed with the
866866keyword ` mod ` . A module item introduces a new, named module into the tree of
@@ -918,19 +918,6 @@ mod thread {
918918}
919919```
920920
921- #### View items
922-
923- ``` {.ebnf .gram}
924- view_item : extern_crate_decl | use_decl ;
925- ```
926-
927- A view item manages the namespace of a module. View items do not define new
928- items, but rather, simply change other items' visibility. There are two
929- kinds of view items:
930-
931- * [ ` extern crate ` declarations] ( #extern-crate-declarations )
932- * [ ` use ` declarations] ( #use-declarations )
933-
934921##### Extern crate declarations
935922
936923``` {.ebnf .gram}
@@ -2891,13 +2878,12 @@ Point3d {y: 0, z: 10, .. base};
28912878### Block expressions
28922879
28932880``` {.ebnf .gram}
2894- block_expr : '{' [ view_item ] *
2895- [ stmt ';' | item ] *
2881+ block_expr : '{' [ stmt ';' | item ] *
28962882 [ expr ] '}' ;
28972883```
28982884
28992885A _ block expression_ is similar to a module in terms of the declarations that
2900- are possible. Each block conceptually introduces a new namespace scope. View
2886+ are possible. Each block conceptually introduces a new namespace scope. Use
29012887items can bring new names into scopes and declared items are in scope for only
29022888the block itself.
29032889
0 commit comments