Skip to content

Commit 9c9615e

Browse files
committed
Auto merge of #29070 - Manishearth:rollup, r=Manishearth
- Successful merges: #28906, #29022, #29047, #29058, #29059, #29060, #29062, #29066, #29068 - Failed merges:
2 parents fa9a421 + 7c7195d commit 9c9615e

Some content is hidden

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

50 files changed

+137
-134
lines changed

COMPILER_TESTS.md

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 7 additions & 7 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

0 commit comments

Comments
 (0)