Skip to content

Commit 39f4874

Browse files
committed
Merge pull request #978 from erikrose/doc-tweaks
Fix some typos and grammar in the docs.
2 parents 93f0e9b + dce9dfe commit 39f4874

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

doc/rust.texi

+10-10
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ features of Rust, relative to other languages.
185185
The initialization state of every slot is statically computed as part of the
186186
typestate system (see below), and requires that all slots are initialized
187187
before use. There is no @code{null} value; uninitialized slots are
188-
uninitialized, and can only be written to, not read.
188+
uninitialized and can only be written to, not read.
189189

190190
The common use for @code{null} in other languages -- as a sentinel value -- is
191191
subsumed into the more general facility of disjoint union types. A program
@@ -197,10 +197,10 @@ must explicitly model its use of such types.
197197
Like many @emph{actor} languages, Rust provides an isolation (and concurrency)
198198
model based on lightweight tasks scheduled by the language runtime. These
199199
tasks are very inexpensive and statically unable to manipulate one another's
200-
local memory. Breaking the rule of task isolation is only possible by calling
200+
local memory. Breaking the rule of task isolation is possible only by calling
201201
external (C/C++) code.
202202

203-
Inter-task communication is typed, asynchronous and simplex, based on passing
203+
Inter-task communication is typed, asynchronous, and simplex, based on passing
204204
messages over channels to ports.
205205

206206
@sp 1
@@ -1136,7 +1136,7 @@ module bar @{
11361136
@end example
11371137

11381138
In future versions of Rust, user-provided extensions to the compiler will be able
1139-
to use interpret attributes. When this facility is provided, a distinction will be
1139+
to interpret attributes. When this facility is provided, a distinction will be
11401140
made between language-reserved and user-available attributes.
11411141

11421142
At present, only the Rust compiler interprets attributes, so all attribute
@@ -1328,13 +1328,13 @@ Local slots are always implicitly mutable.
13281328
Local slots are not initialized when allocated; the entire frame worth of
13291329
local slots are allocated at once, on frame-entry, in an uninitialized
13301330
state. Subsequent statements within a function may or may not initialize the
1331-
local slots. Local slots can only be used after they have been initialized;
1331+
local slots. Local slots can be used only after they have been initialized;
13321332
this condition is guaranteed by the typestate system.
13331333

13341334
References are created for function arguments. If the compiler can not prove
13351335
that the referred-to value will outlive the reference, it will try to set
13361336
aside a copy of that value to refer to. If this is not sematically safe (for
1337-
example, if the referred-to value contains mutable fields), it reject the
1337+
example, if the referred-to value contains mutable fields), it will reject the
13381338
program. If the compiler deems copying the value expensive, it will warn.
13391339

13401340
A function can be declared to take an argument by mutable reference. This
@@ -1996,7 +1996,7 @@ The output type of an iterator is the type of value that the function will
19961996
@code{put}, before it eventually evaluates a @code{ret} or @code{be} expression
19971997
of type @code{()} and completes its execution.
19981998

1999-
An iterator can only be called in the loop header of a matching @code{for
1999+
An iterator can be called only in the loop header of a matching @code{for
20002000
each} loop or as the argument in a @code{put each} expression.
20012001
@xref{Ref.Expr.Foreach}.
20022002

@@ -2108,10 +2108,10 @@ The constructors of a @code{tag} type may be recursive: that is, each constructo
21082108
may take an argument that refers, directly or indirectly, to the tag type the constructor
21092109
is a member of. Such recursion has restrictions:
21102110
@itemize
2111-
@item Recursive types can only be introduced through @code{tag} constructors.
2111+
@item Recursive types can be introduced only through @code{tag} constructors.
21122112
@item A recursive @code{tag} item must have at least one non-recursive
21132113
constructor (in order to give the recursion a basis case).
2114-
@item The recursively argument of recursive tag constructors must be @emph{box}
2114+
@item The recursive argument of recursive tag constructors must be @emph{box}
21152115
values (in order to bound the in-memory size of the constructor).
21162116
@item Recursive type definitions can cross module boundaries, but not module
21172117
@emph{visibility} boundaries, nor crate boundaries (in order to simplify the
@@ -2360,7 +2360,7 @@ values similar to the record type-constructor. The differences are as follows:
23602360

23612361
@itemize
23622362
@item tuple elements cannot be mutable, unlike record fields
2363-
@item tuple elements are not named, and can only be accessed by pattern-matching
2363+
@item tuple elements are not named and can be accessed only by pattern-matching
23642364
@end itemize
23652365

23662366
Tuple types and values are denoted by listing the types or values of

0 commit comments

Comments
 (0)