Skip to content

Commit 280467f

Browse files
committed
---
yaml --- r: 172882 b: refs/heads/try c: 7a0ba8b h: refs/heads/master v: v3
1 parent 719b324 commit 280467f

File tree

2 files changed

+10
-24
lines changed

2 files changed

+10
-24
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 170c4399e614fe599c3d41306b3429ca8b3b68c6
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 5b3cd3900ceda838f5798c30ab96ceb41f962534
5-
refs/heads/try: 99e8c9f9fb63ef2a0e14287e6ee94f5d57e84cc4
5+
refs/heads/try: 7a0ba8b7a18063023bf055e5f91f7562e20f33d7
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/doc/reference.md

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -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

810811
An _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

819820
There 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}
856859
mod_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

865865
A _module item_ is a module, surrounded in braces, named, and prefixed with the
866866
keyword `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}
@@ -2872,13 +2859,12 @@ Point3d {y: 0, z: 10, .. base};
28722859
### Block expressions
28732860

28742861
```{.ebnf .gram}
2875-
block_expr : '{' [ view_item ] *
2876-
[ stmt ';' | item ] *
2862+
block_expr : '{' [ stmt ';' | item ] *
28772863
[ expr ] '}' ;
28782864
```
28792865

28802866
A _block expression_ is similar to a module in terms of the declarations that
2881-
are possible. Each block conceptually introduces a new namespace scope. View
2867+
are possible. Each block conceptually introduces a new namespace scope. Use
28822868
items can bring new names into scopes and declared items are in scope for only
28832869
the block itself.
28842870

0 commit comments

Comments
 (0)