Skip to content

Commit f072827

Browse files
committed
---
yaml --- r: 182568 b: refs/heads/beta c: 838b2ea h: refs/heads/master v: v3
1 parent 10322bf commit f072827

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
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 3102b9e19e7af6f133777e4281d7d4e4d82fe4b0
34+
refs/heads/beta: 838b2ea760282c716f4354b40fafe3cd55ae5ec7
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: eb836bf767aa1d8d4cba488a9091cde3c0ab4b2f

branches/beta/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}
@@ -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

28992885
A _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
29012887
items can bring new names into scopes and declared items are in scope for only
29022888
the block itself.
29032889

0 commit comments

Comments
 (0)