Skip to content

Commit d0cae14

Browse files
committed
Auto merge of #28900 - cristicbz:typos, r=alexcrichton
I found these automatically, but fixed them manually to ensure the semantics are correct. I know things like these are hardly important, since they only marginally improve clarity. But at least for me typos and simple grammatical errors trigger an---unjustified---sense of unprofessionalism, despite the fact that I make them all the time and I understand that they're the sort of thing that is bound to slip through review. Anyway, to find most of these I used: * `ag '.*//.*(\b[A-Za-z]{2,}\b) \1\b'` for repeated words * `ag '\b(the|this|those|these|a|it) (a|the|this|those|these|it)\b'` to find constructs like 'the this' etc. many false positives, but not too hard to scroll through them to actually find the mistakes. * `cat ../../typos.txt | paste -d'|' - - - - - - - - - - - - - - - - - - - - - - | tr '\n' '\0' | xargs -0 -P4 -n1 ag`. Hacky way to find misspellings, but it works ok. I got `typos.txt` from [Wikipedia](https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines) * `ag '.*//.* a ([ae][a-z]|(o[^n])|(i[a-rt-z]))'` to find places where 'a' was followed by a vowel (requiring 'an' instead). I also used a handful more one off regexes that are too boring to reproduce here.
2 parents 11eda66 + 4b308b4 commit d0cae14

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+92
-94
lines changed

src/doc/grammar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ bound := path | lifetime
773773

774774
## Type kinds
775775

776-
**FIXME:** this this probably not relevant to the grammar...
776+
**FIXME:** this is probably not relevant to the grammar...
777777

778778
# Memory and concurrency models
779779

src/doc/trpl/concurrency.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ our value if it's immutable, but we want to be able to mutate it, so we need
195195
something else to persuade the borrow checker we know what we're doing.
196196

197197
It looks like we need some type that allows us to safely mutate a shared value,
198-
for example a type that that can ensure only one thread at a time is able to
198+
for example a type that can ensure only one thread at a time is able to
199199
mutate the value inside it at any one time.
200200

201201
For that, we can use the `Mutex<T>` type!

src/doc/trpl/iterators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ This will print
302302

303303
`filter()` is an adapter that takes a closure as an argument. This closure
304304
returns `true` or `false`. The new iterator `filter()` produces
305-
only the elements that that closure returns `true` for:
305+
only the elements that the closure returns `true` for:
306306

307307
```rust
308308
for i in (1..100).filter(|&x| x % 2 == 0) {

src/etc/test-float-parse/runtests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
7272
Incomplete records are an error. Not-a-Number bit patterns are invalid too.
7373
74-
The tests run serially but the validaition for a a single test is parallelized
74+
The tests run serially but the validation for a single test is parallelized
7575
with ``multiprocessing``. Each test is launched as a subprocess.
7676
One thread supervises it: Accepts and enqueues records to validate, observe
7777
stderr, and waits for the process to exit. A set of worker processes perform

src/libcollections/btree/map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ mod stack {
593593
top: node::Handle<*mut Node<K, V>, Type, NodeType>,
594594
}
595595

596-
/// A `PartialSearchStack` that doesn't hold a a reference to the next node, and is just
596+
/// A `PartialSearchStack` that doesn't hold a reference to the next node, and is just
597597
/// just waiting for a `Handle` to that next node to be pushed. See `PartialSearchStack::with`
598598
/// for more details.
599599
pub struct Pusher<'id, 'a, K:'a, V:'a> {

src/libcollectionstest/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ fn test_find_str() {
8686
assert_eq!(data[43..86].find("iệt"), Some(77 - 43));
8787
assert_eq!(data[43..86].find("Nam"), Some(83 - 43));
8888

89-
// find every substring -- assert that it finds it, or an earlier occurence.
89+
// find every substring -- assert that it finds it, or an earlier occurrence.
9090
let string = "Việt Namacbaabcaabaaba";
9191
for (i, ci) in string.char_indices() {
9292
let ip = i + ci.len_utf8();

src/libcore/cell.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ impl<'b, T: ?Sized> Ref<'b, T> {
598598
}
599599
}
600600

601-
/// Make a new `Ref` for a optional component of the borrowed data, e.g. an
601+
/// Make a new `Ref` for an optional component of the borrowed data, e.g. an
602602
/// enum variant.
603603
///
604604
/// The `RefCell` is already immutably borrowed, so this cannot fail.
@@ -668,7 +668,7 @@ impl<'b, T: ?Sized> RefMut<'b, T> {
668668
}
669669
}
670670

671-
/// Make a new `RefMut` for a optional component of the borrowed data, e.g.
671+
/// Make a new `RefMut` for an optional component of the borrowed data, e.g.
672672
/// an enum variant.
673673
///
674674
/// The `RefCell` is already mutably borrowed, so this cannot fail.

src/libcore/intrinsics.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,20 +373,20 @@ extern "rust-intrinsic" {
373373
/// a size of `count` * `size_of::<T>()` and an alignment of
374374
/// `min_align_of::<T>()`
375375
///
376-
/// The volatile parameter parameter is set to `true`, so it will not be optimized out.
376+
/// The volatile parameter is set to `true`, so it will not be optimized out.
377377
pub fn volatile_copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T,
378378
count: usize);
379379
/// Equivalent to the appropriate `llvm.memmove.p0i8.0i8.*` intrinsic, with
380380
/// a size of `count` * `size_of::<T>()` and an alignment of
381381
/// `min_align_of::<T>()`
382382
///
383-
/// The volatile parameter parameter is set to `true`, so it will not be optimized out.
383+
/// The volatile parameter is set to `true`, so it will not be optimized out.
384384
pub fn volatile_copy_memory<T>(dst: *mut T, src: *const T, count: usize);
385385
/// Equivalent to the appropriate `llvm.memset.p0i8.*` intrinsic, with a
386386
/// size of `count` * `size_of::<T>()` and an alignment of
387387
/// `min_align_of::<T>()`.
388388
///
389-
/// The volatile parameter parameter is set to `true`, so it will not be optimized out.
389+
/// The volatile parameter is set to `true`, so it will not be optimized out.
390390
pub fn volatile_set_memory<T>(dst: *mut T, val: u8, count: usize);
391391

392392
/// Perform a volatile load from the `src` pointer.

src/libcore/marker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ mod impls {
381381
/// ```
382382
///
383383
/// Without the declaration `T:Reflect`, `foo` would not type check
384-
/// (note: as a matter of style, it would be preferable to to write
384+
/// (note: as a matter of style, it would be preferable to write
385385
/// `T:Any`, because `T:Any` implies `T:Reflect` and `T:'static`, but
386386
/// we use `Reflect` here to show how it works). The `Reflect` bound
387387
/// thus serves to alert `foo`'s caller to the fact that `foo` may

src/libcore/num/bignum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ macro_rules! define_bignum {
110110
($name:ident: type=$ty:ty, n=$n:expr) => (
111111
/// Stack-allocated arbitrary-precision (up to certain limit) integer.
112112
///
113-
/// This is backed by an fixed-size array of given type ("digit").
113+
/// This is backed by a fixed-size array of given type ("digit").
114114
/// While the array is not very large (normally some hundred bytes),
115115
/// copying it recklessly may result in the performance hit.
116116
/// Thus this is intentionally not `Copy`.

0 commit comments

Comments
 (0)