Skip to content

Commit 2d94c44

Browse files
committed
Rollup merge of rust-lang#22027 - iblech:patch-1, r=steveklabnik
The first commit adds a short note which I believe will reduce worries in people who work with closures very often and read the Rust book for their first time. The second commit consists solely of tiny typo fixes. In some cases, I changed "logical" quotations like She said, "I like programming". to She said, "I like programming." because the latter seems to be the prevalent style in the book.
2 parents 522091e + 918d097 commit 2d94c44

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

src/doc/trpl/documentation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ comments":
1515
// the "link" crate attribute is currently required for rustdoc, but normally
1616
// isn't needed.
1717
#![crate_id = "universe"]
18-
#![crate_type="lib"]
18+
#![crate_type= lib"]
1919
2020
//! Tools for dealing with universes (this is a doc comment, and is shown on
2121
//! the crate index page. The ! makes it apply to the parent of the comment,

src/doc/trpl/macros.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ The syntax `$(...)*` on the left-hand side of the `=>` in a macro definition
163163
accepts zero or more occurrences of its contents. It works much
164164
like the `*` operator in regular expressions. It also supports a
165165
separator token (a comma-separated list could be written `$(...),*`), and `+`
166-
instead of `*` to mean "at least one".
166+
instead of `*` to mean "at least one."
167167

168168
~~~~
169169
# enum T { SpecialA(u32), SpecialB(u32), SpecialC(u32), SpecialD(u32) }
@@ -195,7 +195,7 @@ As the above example demonstrates, `$(...)*` is also valid on the right-hand
195195
side of a macro definition. The behavior of `*` in transcription,
196196
especially in cases where multiple `*`s are nested, and multiple different
197197
names are involved, can seem somewhat magical and unintuitive at first. The
198-
system that interprets them is called "Macro By Example". The two rules to
198+
system that interprets them is called "Macro By Example." The two rules to
199199
keep in mind are (1) the behavior of `$(...)*` is to walk through one "layer"
200200
of repetitions for all of the `$name`s it contains in lockstep, and (2) each
201201
`$name` must be under at least as many `$(...)*`s as it was matched against.
@@ -309,7 +309,7 @@ there is a solution.
309309

310310
A macro may accept multiple different input grammars. The first one to
311311
successfully match the actual argument to a macro invocation is the one that
312-
"wins".
312+
"wins."
313313

314314
In the case of the example above, we want to write a recursive macro to
315315
process the semicolon-terminated lines, one-by-one. So, we want the following

src/doc/trpl/ownership.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ struct Foo<'a> {
293293
}
294294

295295
fn main() {
296-
let y = &5; // this is the same as `let _y = 5; let y = &_y;
296+
let y = &5; // this is the same as `let _y = 5; let y = &_y;`
297297
let f = Foo { x: y };
298298

299299
println!("{}", f.x);

src/doc/trpl/unsafe.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ crate to allow) and of course requires an `unsafe` block.
308308
## Assembly template
309309

310310
The `assembly template` is the only required parameter and must be a
311-
literal string (i.e `""`)
311+
literal string (i.e. `""`)
312312

313313
```
314314
#![feature(asm)]
@@ -412,15 +412,15 @@ memory, `memory` should also be specified.
412412
## Options
413413

414414
The last section, `options` is specific to Rust. The format is comma
415-
separated literal strings (i.e `:"foo", "bar", "baz"`). It's used to
415+
separated literal strings (i.e. `:"foo", "bar", "baz"`). It's used to
416416
specify some extra info about the inline assembly:
417417

418418
Current valid options are:
419419

420420
1. *volatile* - specifying this is analogous to
421421
`__asm__ __volatile__ (...)` in gcc/clang.
422422
2. *alignstack* - certain instructions expect the stack to be
423-
aligned a certain way (i.e SSE) and specifying this indicates to
423+
aligned a certain way (i.e. SSE) and specifying this indicates to
424424
the compiler to insert its usual stack alignment code
425425
3. *intel* - use intel syntax instead of the default AT&T.
426426

@@ -646,8 +646,8 @@ The `rustc` compiler has certain pluggable operations, that is,
646646
functionality that isn't hard-coded into the language, but is
647647
implemented in libraries, with a special marker to tell the compiler
648648
it exists. The marker is the attribute `#[lang="..."]` and there are
649-
various different values of `...`, i.e. various different "lang
650-
items".
649+
various different values of `...`, i.e. various different 'lang
650+
items'.
651651

652652
For example, `Box` pointers require two lang items, one for allocation
653653
and one for deallocation. A freestanding program that uses the `Box`

src/libcore/iter.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2374,7 +2374,7 @@ impl<A, St, F> Iterator for Unfold<St, F> where F: FnMut(&mut St) -> Option<A> {
23742374
/// iteration
23752375
#[derive(Clone)]
23762376
#[unstable(feature = "core",
2377-
reason = "may be renamed or replaced by range notation adapaters")]
2377+
reason = "may be renamed or replaced by range notation adapters")]
23782378
pub struct Counter<A> {
23792379
/// The current state the counter is at (next value to be yielded)
23802380
state: A,
@@ -2385,7 +2385,7 @@ pub struct Counter<A> {
23852385
/// Creates a new counter with the specified start/step
23862386
#[inline]
23872387
#[unstable(feature = "core",
2388-
reason = "may be renamed or replaced by range notation adapaters")]
2388+
reason = "may be renamed or replaced by range notation adapters")]
23892389
pub fn count<A>(start: A, step: A) -> Counter<A> {
23902390
Counter{state: start, step: step}
23912391
}

0 commit comments

Comments
 (0)