@@ -589,7 +589,7 @@ item : mod_item | fn_item | type_item | enum_item
589
589
~~~~~~~~
590
590
591
591
An _ item_ is a component of a crate; some module items can be defined in
592
- [ crate files] ( #crate-files ) but most are defined in [ source
592
+ [ crate files] ( #crate-files ) , but most are defined in [ source
593
593
files] ( #source-files ) . Items are organized within a crate by a nested set of
594
594
[ modules] ( #modules ) . Every crate has a single "outermost" anonymous module;
595
595
all further items within the crate have [ paths] ( #paths ) within the module tree
@@ -603,7 +603,7 @@ There are several kinds of item:
603
603
* [ modules] ( #modules )
604
604
* [ functions] ( #functions )
605
605
* [ type definitions] ( #type-definitions )
606
- * [ eunmerations ] ( #enumerations )
606
+ * [ enumerations ] ( #enumerations )
607
607
* [ resources] ( #resources )
608
608
* [ interfaces] ( #interfaces )
609
609
* [ implementations] ( #implementations )
@@ -724,9 +724,9 @@ An _import declaration_ creates one or more local name bindings synonymous
724
724
with some other [ path] ( #paths ) . Usually an import declaration is used to
725
725
shorten the path required to refer to a module item.
726
726
727
- * Note* : unlike many languages, Rust's ` import ` declarations do not* declare
728
- * linkage-dependency with external crates. Linkage dependencies are
729
- * independently declared with [ ` use ` declarations] (#use -eclarations ).
727
+ * Note* : unlike many languages, Rust's ` import ` declarations do * not* declare
728
+ linkage-dependency with external crates. Linkage dependencies are
729
+ independently declared with [ ` use ` declarations] ( #use-declarations ) .
730
730
731
731
Imports support a number of "convenience" notations:
732
732
@@ -826,7 +826,7 @@ function passes results back to the caller.
826
826
A function may also be copied into a first class * value* , in which case the
827
827
value has the corresponding [ * function type* ] ( #function-types ) , and can be
828
828
used otherwise exactly as a function item (with a minor additional cost of
829
- calling the function, as such a call is indirect ).
829
+ calling the function indirectly ).
830
830
831
831
Every control path in a function logically ends with a ` ret ` expression or a
832
832
diverging expression. If the outermost block of a function has a
@@ -914,7 +914,7 @@ pure fn nonempty_list<T>(ls: list<T>) -> bool { pure_length(ls) > 0u }
914
914
~~~~
915
915
916
916
In this example, ` nonempty_list ` is a predicate---it can be used in a
917
- typestate constraint---but the auxiliary function ` pure_length ` @ is
917
+ typestate constraint---but the auxiliary function ` pure_length ` is
918
918
not.
919
919
920
920
* ToDo:* should actually define referential transparency.
@@ -1011,7 +1011,7 @@ specific type; the type-specified aspects of a value include:
1011
1011
* The sequence of memory operations required to access the value.
1012
1012
* The * kind* of the type (pinned, unique or shared).
1013
1013
1014
- For example, the type ` {x: u8, y: u8@ ` } defines the set of immutable values
1014
+ For example, the type ` {x: u8, y: u8 ` } defines the set of immutable values
1015
1015
that are composite records, each containing two unsigned 8-bit integers
1016
1016
accessed through the components ` x ` and ` y ` , and laid out in memory with the
1017
1017
` x ` component preceding the ` y ` component.
@@ -1033,7 +1033,7 @@ type the constructor is a member of. Such recursion has restrictions:
1033
1033
values] ( #box-types ) (in order to bound the in-memory size of the
1034
1034
constructor).
1035
1035
* Recursive type definitions can cross module boundaries, but not module
1036
- * visibility* boundaries, nor crate boundaries (in order to simplify the
1036
+ * visibility* boundaries or crate boundaries (in order to simplify the
1037
1037
module system).
1038
1038
1039
1039
@@ -1073,11 +1073,11 @@ resource file_descriptor(fd: int) {
1073
1073
1074
1074
Calling the ` file_descriptor ` constructor function on an integer will
1075
1075
produce a value with the ` file_descriptor ` type. Resource types have a
1076
- noncopyable [ type kind] ( #type-kinds ) , and thus may not be copied. It
1077
- is guaranteed, barring drastic program termination that somehow
1078
- prevents unwinding from taking place, that for each constucted
1079
- resource value, the destructor will run once, when the value is
1080
- disposed of . For stack-allocated values, this happens when the value
1076
+ noncopyable [ type kind] ( #type-kinds ) , and thus may not be copied. The
1077
+ semantics guarantee that for each constructed resources value, the
1078
+ destructor will run once: when the value is disposed of (barring
1079
+ drastic program termination that somehow prevents unwinding from taking
1080
+ place) . For stack-allocated values, disposal happens when the value
1081
1081
goes out of scope. For values in shared boxes, it happens when the
1082
1082
reference count of the box reaches zero.
1083
1083
@@ -1165,9 +1165,9 @@ impl circle_shape of shape for circle {
1165
1165
This defines an implementation named ` circle_shape ` of interface
1166
1166
` shape ` for type ` circle ` . The name of the implementation is the name
1167
1167
by which it is imported and exported, but has no further significance.
1168
- It may be left off to default to the name of the interface that was
1168
+ It may be omitted to default to the name of the interface that was
1169
1169
implemented. Implementation names do not conflict the way other names
1170
- do— multiple implementations with the same name may exist in a scope at
1170
+ do: multiple implementations with the same name may exist in a scope at
1171
1171
the same time.
1172
1172
1173
1173
It is possible to define an implementation without referencing an
@@ -1250,13 +1250,14 @@ fn add(x: int, y: int) { x + y }
1250
1250
~~~~~~~~
1251
1251
1252
1252
In future versions of Rust, user-provided extensions to the compiler will be
1253
- able to interpret attributes. When this facility is provided, a distinction
1254
- will be made between language-reserved and user-available attributes.
1253
+ able to interpret attributes. When this facility is provided, the compiler
1254
+ will distinguish will be made between language-reserved and user-available
1255
+ attributes.
1255
1256
1256
1257
At present, only the Rust compiler interprets attributes, so all attribute
1257
1258
names are effectively reserved. Some significant attributes include:
1258
1259
1259
- * The ` doc ` attribute, for documenting code where it's written .
1260
+ * The ` doc ` attribute, for documenting code in-place .
1260
1261
* The ` cfg ` attribute, for conditional-compilation by build-configuration.
1261
1262
* The ` link ` attribute, for describing linkage metadata for a crate.
1262
1263
* The ` test ` attribute, for marking functions as unit tests.
0 commit comments