Skip to content

Commit 1162b37

Browse files
committed
Correct spelling in docs
1 parent ec4362d commit 1162b37

Some content is hidden

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

43 files changed

+82
-82
lines changed

COMPILER_TESTS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Compiler Test Documentation
22

3-
In the Rust project, we use a special set of comands embedded in
3+
In the Rust project, we use a special set of commands embedded in
44
comments to test the Rust compiler. There are two groups of commands:
55

66
1. Header commands

src/doc/complement-lang-faq.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Cleanup through RAII-style destructors is more likely to work than in catch bloc
7676

7777
## Why aren't modules type-parametric?
7878

79-
We want to maintain the option to parametrize at runtime. We may eventually change this limitation, but initially this is how type parameters were implemented.
79+
We want to maintain the option to parameterize at runtime. We may eventually change this limitation, but initially this is how type parameters were implemented.
8080

8181
## Why aren't values type-parametric? Why only items?
8282

src/doc/nomicon/casts.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ For numeric casts, there are quite a few cases to consider:
5252
* zero-extend if the source is unsigned
5353
* sign-extend if the source is signed
5454
* casting from a float to an integer will round the float towards zero
55-
* **[NOTE: currently this will cause Undefined Behaviour if the rounded
55+
* **[NOTE: currently this will cause Undefined Behavior if the rounded
5656
value cannot be represented by the target integer type][float-int]**.
5757
This includes Inf and NaN. This is a bug and will be fixed.
5858
* casting from an integer to float will produce the floating point
@@ -61,7 +61,7 @@ For numeric casts, there are quite a few cases to consider:
6161
* casting from an f32 to an f64 is perfect and lossless
6262
* casting from an f64 to an f32 will produce the closest possible value
6363
(rounding strategy unspecified)
64-
* **[NOTE: currently this will cause Undefined Behaviour if the value
64+
* **[NOTE: currently this will cause Undefined Behavior if the value
6565
is finite but larger or smaller than the largest or smallest finite
6666
value representable by f32][float-float]**. This is a bug and will
6767
be fixed.

src/doc/nomicon/dropck.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interacted with the *outlives* relationship in an inclusive manner. That is,
66
when we talked about `'a: 'b`, it was ok for `'a` to live *exactly* as long as
77
`'b`. At first glance, this seems to be a meaningless distinction. Nothing ever
88
gets dropped at the same time as another, right? This is why we used the
9-
following desugarring of `let` statements:
9+
following desugaring of `let` statements:
1010

1111
```rust,ignore
1212
let x;

src/doc/nomicon/exotic-sizes.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ information that "completes" them (more on this below).
2020
There are two major DSTs exposed by the language: trait objects, and slices.
2121

2222
A trait object represents some type that implements the traits it specifies.
23-
The exact original type is *erased* in favour of runtime reflection
23+
The exact original type is *erased* in favor of runtime reflection
2424
with a vtable containing all the information necessary to use the type.
2525
This is the information that completes a trait object: a pointer to its vtable.
2626

@@ -128,7 +128,7 @@ But neither of these tricks work today, so all Void types get you is
128128
the ability to be confident that certain situations are statically impossible.
129129

130130
One final subtle detail about empty types is that raw pointers to them are
131-
actually valid to construct, but dereferencing them is Undefined Behaviour
131+
actually valid to construct, but dereferencing them is Undefined Behavior
132132
because that doesn't actually make sense. That is, you could model C's `void *`
133133
type with `*const Void`, but this doesn't necessarily gain anything over using
134134
e.g. `*const ()`, which *is* safe to randomly dereference.

src/doc/nomicon/leaking.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ let mut vec = vec![Box::new(0); 4];
9090
println!("{}", vec[0]);
9191
```
9292

93-
This is pretty clearly Not Good. Unfortunately, we're kind've stuck between a
93+
This is pretty clearly Not Good. Unfortunately, we're kind of stuck between a
9494
rock and a hard place: maintaining consistent state at every step has an
9595
enormous cost (and would negate any benefits of the API). Failing to maintain
9696
consistent state gives us Undefined Behavior in safe code (making the API
@@ -248,4 +248,4 @@ let mut data = Box::new(0);
248248
```
249249

250250
Dang. Here the destructor running was pretty fundamental to the API, and it had
251-
to be scrapped in favour of a completely different design.
251+
to be scrapped in favor of a completely different design.

src/doc/nomicon/meet-safe-and-unsafe.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ do some really crazy unsafe things.
2626

2727
Safe Rust is the *true* Rust programming language. If all you do is write Safe
2828
Rust, you will never have to worry about type-safety or memory-safety. You will
29-
never endure a null or dangling pointer, or any of that Undefined Behaviour
29+
never endure a null or dangling pointer, or any of that Undefined Behavior
3030
nonsense.
3131

3232
*That's totally awesome.*
@@ -52,11 +52,11 @@ The only things that are different in Unsafe Rust are that you can:
5252
* Mutate statics
5353

5454
That's it. The reason these operations are relegated to Unsafe is that misusing
55-
any of these things will cause the ever dreaded Undefined Behaviour. Invoking
56-
Undefined Behaviour gives the compiler full rights to do arbitrarily bad things
57-
to your program. You definitely *should not* invoke Undefined Behaviour.
55+
any of these things will cause the ever dreaded Undefined Behavior. Invoking
56+
Undefined Behavior gives the compiler full rights to do arbitrarily bad things
57+
to your program. You definitely *should not* invoke Undefined Behavior.
5858

59-
Unlike C, Undefined Behaviour is pretty limited in scope in Rust. All the core
59+
Unlike C, Undefined Behavior is pretty limited in scope in Rust. All the core
6060
language cares about is preventing the following things:
6161

6262
* Dereferencing null or dangling pointers
@@ -71,9 +71,9 @@ language cares about is preventing the following things:
7171
* Unwinding into another language
7272
* Causing a [data race][race]
7373

74-
That's it. That's all the causes of Undefined Behaviour baked into Rust. Of
74+
That's it. That's all the causes of Undefined Behavior baked into Rust. Of
7575
course, unsafe functions and traits are free to declare arbitrary other
76-
constraints that a program must maintain to avoid Undefined Behaviour. However,
76+
constraints that a program must maintain to avoid Undefined Behavior. However,
7777
generally violations of these constraints will just transitively lead to one of
7878
the above problems. Some additional constraints may also derive from compiler
7979
intrinsics that make special assumptions about how code can be optimized.

src/doc/nomicon/races.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Safe Rust guarantees an absence of data races, which are defined as:
66
* one of them is a write
77
* one of them is unsynchronized
88

9-
A data race has Undefined Behaviour, and is therefore impossible to perform
9+
A data race has Undefined Behavior, and is therefore impossible to perform
1010
in Safe Rust. Data races are *mostly* prevented through rust's ownership system:
1111
it's impossible to alias a mutable reference, so it's impossible to perform a
1212
data race. Interior mutability makes this more complicated, which is largely why
@@ -53,7 +53,7 @@ thread::spawn(move || {
5353
// bounds checked, and there's no chance of the value getting changed
5454
// in the middle. However our program may panic if the thread we spawned
5555
// managed to increment before this ran. A race condition because correct
56-
// program execution (panicing is rarely correct) depends on order of
56+
// program execution (panicking is rarely correct) depends on order of
5757
// thread execution.
5858
println!("{}", data[idx.load(Ordering::SeqCst)]);
5959
```

src/doc/nomicon/safe-unsafe-meaning.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Some examples of unsafe functions:
4141

4242
* `slice::get_unchecked` will perform unchecked indexing, allowing memory
4343
safety to be freely violated.
44-
* `ptr::offset` is an intrinsic that invokes Undefined Behaviour if it is
44+
* `ptr::offset` is an intrinsic that invokes Undefined Behavior if it is
4545
not "in bounds" as defined by LLVM.
4646
* `mem::transmute` reinterprets some value as having the given type,
4747
bypassing type safety in arbitrary ways. (see [conversions] for details)
@@ -59,9 +59,9 @@ As of Rust 1.0 there are exactly two unsafe traits:
5959
The need for unsafe traits boils down to the fundamental property of safe code:
6060

6161
**No matter how completely awful Safe code is, it can't cause Undefined
62-
Behaviour.**
62+
Behavior.**
6363

64-
This means that Unsafe Rust, **the royal vanguard of Undefined Behaviour**, has to be
64+
This means that Unsafe Rust, **the royal vanguard of Undefined Behavior**, has to be
6565
*super paranoid* about generic safe code. To be clear, Unsafe Rust is totally free to trust
6666
specific safe code. Anything else would degenerate into infinite spirals of
6767
paranoid despair. In particular it's generally regarded as ok to trust the standard library

src/doc/nomicon/send-and-sync.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ implement, and other unsafe code can assume that they are correctly
1515
implemented. Since they're *marker traits* (they have no associated items like
1616
methods), correctly implemented simply means that they have the intrinsic
1717
properties an implementor should have. Incorrectly implementing Send or Sync can
18-
cause Undefined Behaviour.
18+
cause Undefined Behavior.
1919

2020
Send and Sync are also automatically derived traits. This means that, unlike
2121
every other trait, if a type is composed entirely of Send or Sync types, then it

src/doc/nomicon/transmutes.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ horribly unsafe thing you can do in Rust. The railguards here are dental floss.
88

99
`mem::transmute<T, U>` takes a value of type `T` and reinterprets it to have
1010
type `U`. The only restriction is that the `T` and `U` are verified to have the
11-
same size. The ways to cause Undefined Behaviour with this are mind boggling.
11+
same size. The ways to cause Undefined Behavior with this are mind boggling.
1212

1313
* First and foremost, creating an instance of *any* type with an invalid state
1414
is going to cause arbitrary chaos that can't really be predicted.
@@ -26,7 +26,7 @@ same size. The ways to cause Undefined Behaviour with this are mind boggling.
2626
`mem::transmute_copy<T, U>` somehow manages to be *even more* wildly unsafe than
2727
this. It copies `size_of<U>` bytes out of an `&T` and interprets them as a `U`.
2828
The size check that `mem::transmute` has is gone (as it may be valid to copy
29-
out a prefix), though it is Undefined Behaviour for `U` to be larger than `T`.
29+
out a prefix), though it is Undefined Behavior for `U` to be larger than `T`.
3030

3131
Also of course you can get most of the functionality of these functions using
3232
pointer casts.

src/doc/nomicon/unbounded-lifetimes.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
Unsafe code can often end up producing references or lifetimes out of thin air.
44
Such lifetimes come into the world as *unbounded*. The most common source of this
5-
is derefencing a raw pointer, which produces a reference with an unbounded lifetime.
5+
is dereferencing a raw pointer, which produces a reference with an unbounded lifetime.
66
Such a lifetime becomes as big as context demands. This is in fact more powerful
77
than simply becoming `'static`, because for instance `&'static &'a T`
88
will fail to typecheck, but the unbound lifetime will perfectly mold into
99
`&'a &'a T` as needed. However for most intents and purposes, such an unbounded
1010
lifetime can be regarded as `'static`.
1111

1212
Almost no reference is `'static`, so this is probably wrong. `transmute` and
13-
`transmute_copy` are the two other primary offenders. One should endeavour to
13+
`transmute_copy` are the two other primary offenders. One should endeavor to
1414
bound an unbounded lifetime as quick as possible, especially across function
1515
boundaries.
1616

src/doc/nomicon/unchecked-uninit.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dropping the old value: `write`, `copy`, and `copy_nonoverlapping`.
3838
(this is equivalent to memcpy -- note that the argument order is reversed!)
3939

4040
It should go without saying that these functions, if misused, will cause serious
41-
havoc or just straight up Undefined Behaviour. The only things that these
41+
havoc or just straight up Undefined Behavior. The only things that these
4242
functions *themselves* require is that the locations you want to read and write
4343
are allocated. However the ways writing arbitrary bits to arbitrary
4444
locations of memory can break things are basically uncountable!

src/doc/nomicon/uninitialized.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ All runtime-allocated memory in a Rust program begins its life as
44
*uninitialized*. In this state the value of the memory is an indeterminate pile
55
of bits that may or may not even reflect a valid state for the type that is
66
supposed to inhabit that location of memory. Attempting to interpret this memory
7-
as a value of *any* type will cause Undefined Behaviour. Do Not Do This.
7+
as a value of *any* type will cause Undefined Behavior. Do Not Do This.
88

99
Rust provides mechanisms to work with uninitialized memory in checked (safe) and
10-
unchecked (unsafe) ways.
10+
unchecked (unsafe) ways.

src/doc/nomicon/unwinding.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ should only panic for programming errors or *extreme* problems.
4242

4343
Rust's unwinding strategy is not specified to be fundamentally compatible
4444
with any other language's unwinding. As such, unwinding into Rust from another
45-
language, or unwinding into another language from Rust is Undefined Behaviour.
45+
language, or unwinding into another language from Rust is Undefined Behavior.
4646
You must *absolutely* catch any panics at the FFI boundary! What you do at that
4747
point is up to you, but *something* must be done. If you fail to do this,
4848
at best, your application will crash and burn. At worst, your application *won't*

src/doc/nomicon/vec-layout.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub struct Vec<T> {
9393
If you don't care about the null-pointer optimization, then you can use the
9494
stable code. However we will be designing the rest of the code around enabling
9595
the optimization. In particular, `Unique::new` is unsafe to call, because
96-
putting `null` inside of it is Undefined Behaviour. Our stable Unique doesn't
96+
putting `null` inside of it is Undefined Behavior. Our stable Unique doesn't
9797
need `new` to be unsafe because it doesn't make any interesting guarantees about
9898
its contents.
9999

src/doc/nomicon/vec-push-pop.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Easy! How about `pop`? Although this time the index we want to access is
3434
initialized, Rust won't just let us dereference the location of memory to move
3535
the value out, because that would leave the memory uninitialized! For this we
3636
need `ptr::read`, which just copies out the bits from the target address and
37-
intrprets it as a value of type T. This will leave the memory at this address
37+
interprets it as a value of type T. This will leave the memory at this address
3838
logically uninitialized, even though there is in fact a perfectly good instance
3939
of T there.
4040

src/doc/nomicon/vec-zsts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% Handling Zero-Sized Types
22

3-
It's time. We're going to fight the spectre that is zero-sized types. Safe Rust
3+
It's time. We're going to fight the specter that is zero-sized types. Safe Rust
44
*never* needs to care about this, but Vec is very intensive on raw pointers and
55
raw allocations, which are exactly the two things that care about
66
zero-sized types. We need to be careful of two things:

src/doc/reference.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3706,7 +3706,7 @@ repeated sub-expression is a coercion site for coercion to type `U`.
37063706
Each sub-expression is a coercion site to the respective type, e.g. the
37073707
zeroth sub-expression is a coercion site to type `U_0`.
37083708

3709-
* Parenthesised sub-expressions (`(e)`): if the expression has type `U`, then
3709+
* Parenthesized sub-expressions (`(e)`): if the expression has type `U`, then
37103710
the sub-expression is a coercion site to `U`.
37113711

37123712
* Blocks: if a block has type `U`, then the last expression in the block (if
@@ -4072,7 +4072,7 @@ that have since been removed):
40724072

40734073
* SML, OCaml: algebraic data types, pattern matching, type inference,
40744074
semicolon statement separation
4075-
* C++: references, RAII, smart pointers, move semantics, monomorphisation,
4075+
* C++: references, RAII, smart pointers, move semantics, monomorphization,
40764076
memory model
40774077
* ML Kit, Cyclone: region based memory management
40784078
* Haskell (GHC): typeclasses, type families

src/doc/style/features/modules.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ Organize module headers as follows:
1717
Avoid using `#[path="..."]` directives; make the file system and
1818
module hierarchy match, instead.
1919

20-
### Use the module hirearchy to organize APIs into coherent sections. [FIXME]
20+
### Use the module hierarchy to organize APIs into coherent sections. [FIXME]
2121

2222
> **[FIXME]** Flesh this out with examples; explain what a "coherent
2323
> section" is with examples.
2424
>
25-
> The module hirearchy defines both the public and internal API of your module.
25+
> The module hierarchy defines both the public and internal API of your module.
2626
> Breaking related functionality into submodules makes it understandable to both
2727
> users and contributors to the module.
2828
@@ -82,7 +82,7 @@ io/mod.rs
8282
```
8383

8484
While it is possible to define all of `io` within a single directory,
85-
mirroring the module hirearchy in the directory structure makes
85+
mirroring the module hierarchy in the directory structure makes
8686
submodules of `io::net` easier to find.
8787

8888
### Consider top-level definitions or reexports. [FIXME: needs RFC]
@@ -104,13 +104,13 @@ while
104104
[`TcpStream`](https://doc.rust-lang.org/std/io/net/tcp/struct.TcpStream.html)
105105
is defined in `io/net/tcp.rs` and reexported in the `io` module.
106106

107-
### Use internal module hirearchies for organization. [FIXME: needs RFC]
107+
### Use internal module hierarchies for organization. [FIXME: needs RFC]
108108

109109
> **[FIXME]**
110110
> - Referencing internal modules from the standard library is subject to
111111
> becoming outdated.
112112
113-
Internal module hirearchies (i.e., private submodules) may be used to
113+
Internal module hierarchies (i.e., private submodules) may be used to
114114
hide implementation details that are not part of the module's API.
115115

116116
For example, in [`std::io`](https://doc.rust-lang.org/std/io/), `mod mem`

src/doc/style/features/traits/reuse.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
> **[FIXME]** We probably want to discourage this, at least when used in a way
66
> that is publicly exposed.
77
8-
Traits that provide default implmentations for function can provide code reuse
8+
Traits that provide default implementations for function can provide code reuse
99
across types. For example, a `print` method can be defined across multiple
1010
types as follows:
1111

src/doc/trpl/dining-philosophers.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Hoare in 1985.
1313
> dining room, furnished with a circular table, surrounded by five chairs, each
1414
> labelled by the name of the philosopher who was to sit in it. They sat
1515
> anticlockwise around the table. To the left of each philosopher there was
16-
> laid a golden fork, and in the centre stood a large bowl of spaghetti, which
16+
> laid a golden fork, and in the center stood a large bowl of spaghetti, which
1717
> was constantly replenished. A philosopher was expected to spend most of
1818
> their time thinking; but when they felt hungry, they went to the dining
1919
> room, sat down in their own chair, picked up their own fork on their left,

0 commit comments

Comments
 (0)