Skip to content

Commit 704210e

Browse files
committed
Typos, section 5
1 parent bb54979 commit 704210e

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

doc/rust.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ item : mod_item | fn_item | type_item | enum_item
589589
~~~~~~~~
590590

591591
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
593593
files](#source-files). Items are organized within a crate by a nested set of
594594
[modules](#modules). Every crate has a single "outermost" anonymous module;
595595
all further items within the crate have [paths](#paths) within the module tree
@@ -603,7 +603,7 @@ There are several kinds of item:
603603
* [modules](#modules)
604604
* [functions](#functions)
605605
* [type definitions](#type-definitions)
606-
* [eunmerations](#enumerations)
606+
* [enumerations](#enumerations)
607607
* [resources](#resources)
608608
* [interfaces](#interfaces)
609609
* [implementations](#implementations)
@@ -724,9 +724,9 @@ An _import declaration_ creates one or more local name bindings synonymous
724724
with some other [path](#paths). Usually an import declaration is used to
725725
shorten the path required to refer to a module item.
726726

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).
730730

731731
Imports support a number of "convenience" notations:
732732

@@ -826,7 +826,7 @@ function passes results back to the caller.
826826
A function may also be copied into a first class *value*, in which case the
827827
value has the corresponding [*function type*](#function-types), and can be
828828
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).
830830

831831
Every control path in a function logically ends with a `ret` expression or a
832832
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 }
914914
~~~~
915915

916916
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
918918
not.
919919

920920
*ToDo:* should actually define referential transparency.
@@ -1011,7 +1011,7 @@ specific type; the type-specified aspects of a value include:
10111011
* The sequence of memory operations required to access the value.
10121012
* The *kind* of the type (pinned, unique or shared).
10131013

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
10151015
that are composite records, each containing two unsigned 8-bit integers
10161016
accessed through the components `x` and `y`, and laid out in memory with the
10171017
`x` component preceding the `y` component.
@@ -1033,7 +1033,7 @@ type the constructor is a member of. Such recursion has restrictions:
10331033
values](#box-types) (in order to bound the in-memory size of the
10341034
constructor).
10351035
* 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
10371037
module system).
10381038

10391039

@@ -1073,11 +1073,11 @@ resource file_descriptor(fd: int) {
10731073

10741074
Calling the `file_descriptor` constructor function on an integer will
10751075
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
10811081
goes out of scope. For values in shared boxes, it happens when the
10821082
reference count of the box reaches zero.
10831083

@@ -1165,9 +1165,9 @@ impl circle_shape of shape for circle {
11651165
This defines an implementation named `circle_shape` of interface
11661166
`shape` for type `circle`. The name of the implementation is the name
11671167
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
11691169
implemented. Implementation names do not conflict the way other names
1170-
domultiple 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
11711171
the same time.
11721172

11731173
It is possible to define an implementation without referencing an
@@ -1250,13 +1250,14 @@ fn add(x: int, y: int) { x + y }
12501250
~~~~~~~~
12511251

12521252
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.
12551256

12561257
At present, only the Rust compiler interprets attributes, so all attribute
12571258
names are effectively reserved. Some significant attributes include:
12581259

1259-
* The `doc` attribute, for documenting code where it's written.
1260+
* The `doc` attribute, for documenting code in-place.
12601261
* The `cfg` attribute, for conditional-compilation by build-configuration.
12611262
* The `link` attribute, for describing linkage metadata for a crate.
12621263
* The `test` attribute, for marking functions as unit tests.

0 commit comments

Comments
 (0)