Skip to content

Commit c2be91e

Browse files
committed
Auto merge of #28847 - Ms2ger:typos, r=steveklabnik
2 parents be96988 + 6b5349a commit c2be91e

File tree

9 files changed

+17
-17
lines changed

9 files changed

+17
-17
lines changed

src/doc/nomicon/destructors.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ boilerplate" to drop children. If a struct has no special logic for being
1717
dropped other than dropping its children, then it means `Drop` doesn't need to
1818
be implemented at all!
1919

20-
**There is no stable way to prevent this behaviour in Rust 1.0.**
20+
**There is no stable way to prevent this behavior in Rust 1.0.**
2121

2222
Note that taking `&mut self` means that even if you could suppress recursive
2323
Drop, Rust will prevent you from e.g. moving fields out of self. For most types,
@@ -101,7 +101,7 @@ After we deallocate the `box`'s ptr in SuperBox's destructor, Rust will
101101
happily proceed to tell the box to Drop itself and everything will blow up with
102102
use-after-frees and double-frees.
103103

104-
Note that the recursive drop behaviour applies to all structs and enums
104+
Note that the recursive drop behavior applies to all structs and enums
105105
regardless of whether they implement Drop. Therefore something like
106106

107107
```rust

src/doc/nomicon/drop-flags.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ y = x; // y was init; Drop y, overwrite it, and make x uninit!
4040
// x goes out of scope; x was uninit; do nothing.
4141
```
4242

43-
Similarly, branched code where all branches have the same behaviour with respect
43+
Similarly, branched code where all branches have the same behavior with respect
4444
to initialization has static drop semantics:
4545

4646
```rust

src/doc/nomicon/leaking.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ println!("{}", vec[0]);
9393
This is pretty clearly Not Good. Unfortunately, we're kind've 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
96-
consistent state gives us Undefined Behaviour in safe code (making the API
96+
consistent state gives us Undefined Behavior in safe code (making the API
9797
unsound).
9898

9999
So what can we do? Well, we can pick a trivially consistent state: set the Vec's
100100
len to be 0 when we start the iteration, and fix it up if necessary in the
101101
destructor. That way, if everything executes like normal we get the desired
102-
behaviour with minimal overhead. But if someone has the *audacity* to
102+
behavior with minimal overhead. But if someone has the *audacity* to
103103
mem::forget us in the middle of the iteration, all that does is *leak even more*
104104
(and possibly leave the Vec in an unexpected but otherwise consistent state).
105105
Since we've accepted that mem::forget is safe, this is definitely safe. We call

src/doc/nomicon/other-reprs.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ kept in mind. Due to its dual purpose as "for FFI" and "for layout control",
1919
`repr(C)` can be applied to types that will be nonsensical or problematic if
2020
passed through the FFI boundary.
2121

22-
* ZSTs are still zero-sized, even though this is not a standard behaviour in
23-
C, and is explicitly contrary to the behaviour of an empty type in C++, which
22+
* ZSTs are still zero-sized, even though this is not a standard behavior in
23+
C, and is explicitly contrary to the behavior of an empty type in C++, which
2424
still consumes a byte of space.
2525

2626
* DSTs, tuples, and tagged unions are not a concept in C and as such are never
@@ -65,7 +65,7 @@ compiler might be able to paper over alignment issues with shifts and masks.
6565
However if you take a reference to a packed field, it's unlikely that the
6666
compiler will be able to emit code to avoid an unaligned load.
6767

68-
**[As of Rust 1.0 this can cause undefined behaviour.][ub loads]**
68+
**[As of Rust 1.0 this can cause undefined behavior.][ub loads]**
6969

7070
`repr(packed)` is not to be used lightly. Unless you have extreme requirements,
7171
this should not be used.

src/doc/nomicon/repr-rust.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ value of alignment `n` must only be stored at an address that is a multiple of
66
`n`. So alignment 2 means you must be stored at an even address, and 1 means
77
that you can be stored anywhere. Alignment is at least 1, and always a power of
88
2. Most primitives are generally aligned to their size, although this is
9-
platform-specific behaviour. In particular, on x86 `u64` and `f64` may be only
9+
platform-specific behavior. In particular, on x86 `u64` and `f64` may be only
1010
aligned to 32 bits.
1111

1212
A type's size must always be a multiple of its alignment. This ensures that an

src/doc/nomicon/vec-zsts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ It's time. We're going to fight the spectre that is zero-sized types. Safe Rust
55
raw allocations, which are exactly the two things that care about
66
zero-sized types. We need to be careful of two things:
77

8-
* The raw allocator API has undefined behaviour if you pass in 0 for an
8+
* The raw allocator API has undefined behavior if you pass in 0 for an
99
allocation size.
1010
* raw pointer offsets are no-ops for zero-sized types, which will break our
1111
C-style pointer iterator.

src/librustc/middle/free_region.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
//! This file handles the relationships between free regions --
1212
//! meaning lifetime parameters. Ordinarily, free regions are
13-
//! unrelated to one another, but they can be related vai implied or
13+
//! unrelated to one another, but they can be related via implied or
1414
//! explicit bounds. In that case, we track the bounds using the
1515
//! `TransitiveRelation` type and use that to decide when one free
1616
//! region outlives another and so forth.

src/librustc_mir/hair.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub trait Hair: Sized+Debug+Clone+Eq+Hash { // (*)
5656
/// Returns the type `usize`.
5757
fn usize_ty(&mut self) -> Self::Ty;
5858

59-
/// Returns the literal for `true`
59+
/// Returns the literal for `value` as a `usize`.
6060
fn usize_literal(&mut self, value: usize) -> Literal<Self>;
6161

6262
/// Returns the type `bool`.
@@ -65,7 +65,7 @@ pub trait Hair: Sized+Debug+Clone+Eq+Hash { // (*)
6565
/// Returns the literal for `true`
6666
fn true_literal(&mut self) -> Literal<Self>;
6767

68-
/// Returns the literal for `true`
68+
/// Returns the literal for `false`
6969
fn false_literal(&mut self) -> Literal<Self>;
7070

7171
/// Returns a reference to `PartialEq::<T,T>::eq`

src/librustc_typeck/diagnostics.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1819,7 +1819,7 @@ fn bar(foo: Foo) -> u32 {
18191819
}
18201820
```
18211821
1822-
Try using `{}` isntead:
1822+
Try using `{}` instead:
18231823
18241824
```
18251825
fn bar(foo: Foo) -> u32 {
@@ -2010,8 +2010,8 @@ wrapped type `T` implements `Clone`. The `where` clause is important because
20102010
some types will not implement `Clone`, and thus will not get this method.
20112011
20122012
In our erroneous example, however, we're referencing a single concrete type.
2013-
Since we know for certain that Wrapper<u32> implements Clone, there's no reason
2014-
to also specify it in a `where` clause.
2013+
Since we know for certain that `Wrapper<u32>` implements `Clone`, there's no
2014+
reason to also specify it in a `where` clause.
20152015
"##,
20162016

20172017
E0194: r##"
@@ -2581,7 +2581,7 @@ In this example, we're attempting to take a type of `Foo::Bar` in the
25812581
do_something function. This is not legal: `Foo::Bar` is a value of type `Foo`,
25822582
not a distinct static type. Likewise, it's not legal to attempt to
25832583
`impl Foo::Bar`: instead, you must `impl Foo` and then pattern match to specify
2584-
behaviour for specific enum variants.
2584+
behavior for specific enum variants.
25852585
"##,
25862586

25872587
E0249: r##"

0 commit comments

Comments
 (0)