]> git.lizzy.rs Git - rust.git/commitdiff
Fix some typos.
authorMs2ger <Ms2ger@gmail.com>
Sun, 23 Aug 2015 09:52:13 +0000 (11:52 +0200)
committerMs2ger <Ms2ger@gmail.com>
Mon, 5 Oct 2015 14:48:57 +0000 (16:48 +0200)
src/doc/nomicon/destructors.md
src/doc/nomicon/drop-flags.md
src/doc/nomicon/leaking.md
src/doc/nomicon/other-reprs.md
src/doc/nomicon/repr-rust.md
src/doc/nomicon/vec-zsts.md
src/librustc/middle/free_region.rs
src/librustc_mir/hair.rs
src/librustc_typeck/diagnostics.rs

index 91abdab9778f2fc55a9ed9a72474f95334464599..1feb085ba52e630dbf0109fbaaf9202f1ca95872 100644 (file)
@@ -17,7 +17,7 @@ boilerplate" to drop children. If a struct has no special logic for being
 dropped other than dropping its children, then it means `Drop` doesn't need to
 be implemented at all!
 
-**There is no stable way to prevent this behaviour in Rust 1.0.**
+**There is no stable way to prevent this behavior in Rust 1.0.**
 
 Note that taking `&mut self` means that even if you could suppress recursive
 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
 happily proceed to tell the box to Drop itself and everything will blow up with
 use-after-frees and double-frees.
 
-Note that the recursive drop behaviour applies to all structs and enums
+Note that the recursive drop behavior applies to all structs and enums
 regardless of whether they implement Drop. Therefore something like
 
 ```rust
index 5655c5d245ce0638658550e82814e7a6d2389d4b..cfceafe1bdf23ec4294224720c13bc98bece967c 100644 (file)
@@ -40,7 +40,7 @@ y = x;                   // y was init; Drop y, overwrite it, and make x uninit!
                          // x goes out of scope; x was uninit; do nothing.
 ```
 
-Similarly, branched code where all branches have the same behaviour with respect
+Similarly, branched code where all branches have the same behavior with respect
 to initialization has static drop semantics:
 
 ```rust
index 0441db27526f870bf3d7edde3261b86bdf70a71d..445349b406593681f90e40bd4f24e514a0a50487 100644 (file)
@@ -93,13 +93,13 @@ println!("{}", vec[0]);
 This is pretty clearly Not Good. Unfortunately, we're kind've stuck between a
 rock and a hard place: maintaining consistent state at every step has an
 enormous cost (and would negate any benefits of the API). Failing to maintain
-consistent state gives us Undefined Behaviour in safe code (making the API
+consistent state gives us Undefined Behavior in safe code (making the API
 unsound).
 
 So what can we do? Well, we can pick a trivially consistent state: set the Vec's
 len to be 0 when we start the iteration, and fix it up if necessary in the
 destructor. That way, if everything executes like normal we get the desired
-behaviour with minimal overhead. But if someone has the *audacity* to
+behavior with minimal overhead. But if someone has the *audacity* to
 mem::forget us in the middle of the iteration, all that does is *leak even more*
 (and possibly leave the Vec in an unexpected but otherwise consistent state).
 Since we've accepted that mem::forget is safe, this is definitely safe. We call
index 71da743f35d3cbc92784c5001eb0a601931cef9c..e361fbb7ae868ecaa668da896110d076b9de68e5 100644 (file)
@@ -19,8 +19,8 @@ kept in mind. Due to its dual purpose as "for FFI" and "for layout control",
 `repr(C)` can be applied to types that will be nonsensical or problematic if
 passed through the FFI boundary.
 
-* ZSTs are still zero-sized, even though this is not a standard behaviour in
-C, and is explicitly contrary to the behaviour of an empty type in C++, which
+* ZSTs are still zero-sized, even though this is not a standard behavior in
+C, and is explicitly contrary to the behavior of an empty type in C++, which
 still consumes a byte of space.
 
 * 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.
 However if you take a reference to a packed field, it's unlikely that the
 compiler will be able to emit code to avoid an unaligned load.
 
-**[As of Rust 1.0 this can cause undefined behaviour.][ub loads]**
+**[As of Rust 1.0 this can cause undefined behavior.][ub loads]**
 
 `repr(packed)` is not to be used lightly. Unless you have extreme requirements,
 this should not be used.
index e038ae5639bf6d3111d2a084f7dff52db0317ea4..5abece4d362cf349c8069d9ffc2fe81369d88738 100644 (file)
@@ -6,7 +6,7 @@ value of alignment `n` must only be stored at an address that is a multiple of
 `n`. So alignment 2 means you must be stored at an even address, and 1 means
 that you can be stored anywhere. Alignment is at least 1, and always a power of
 2. Most primitives are generally aligned to their size, although this is
-platform-specific behaviour. In particular, on x86 `u64` and `f64` may be only
+platform-specific behavior. In particular, on x86 `u64` and `f64` may be only
 aligned to 32 bits.
 
 A type's size must always be a multiple of its alignment. This ensures that an
index 72e8a34488bae73751aa6306d60613d32321bbdc..9b1abf383f7175003f2997cda1d11713355e5669 100644 (file)
@@ -5,7 +5,7 @@ It's time. We're going to fight the spectre that is zero-sized types. Safe Rust
 raw allocations, which are exactly the two things that care about
 zero-sized types. We need to be careful of two things:
 
-* The raw allocator API has undefined behaviour if you pass in 0 for an
+* The raw allocator API has undefined behavior if you pass in 0 for an
   allocation size.
 * raw pointer offsets are no-ops for zero-sized types, which will break our
   C-style pointer iterator.
index 2e9e5fafb1d9b348dce9a2afb58aa48d37422160..face6d629340db1aaf6aef013984b1f38828c870 100644 (file)
@@ -10,7 +10,7 @@
 
 //! This file handles the relationships between free regions --
 //! meaning lifetime parameters. Ordinarily, free regions are
-//! unrelated to one another, but they can be related vai implied or
+//! unrelated to one another, but they can be related via implied or
 //! explicit bounds.  In that case, we track the bounds using the
 //! `TransitiveRelation` type and use that to decide when one free
 //! region outlives another and so forth.
index f4eb03c5d07c2371dbbfd0660cc3e9dd75117bf3..18f2dd6dc6ec020e530b6257458c531feb160180 100644 (file)
@@ -56,7 +56,7 @@ fn mirror<M:Mirror<Self>>(&mut self, ast: M) -> M::Output {
     /// Returns the type `usize`.
     fn usize_ty(&mut self) -> Self::Ty;
 
-    /// Returns the literal for `true`
+    /// Returns the literal for `value` as a `usize`.
     fn usize_literal(&mut self, value: usize) -> Literal<Self>;
 
     /// Returns the type `bool`.
@@ -65,7 +65,7 @@ fn mirror<M:Mirror<Self>>(&mut self, ast: M) -> M::Output {
     /// Returns the literal for `true`
     fn true_literal(&mut self) -> Literal<Self>;
 
-    /// Returns the literal for `true`
+    /// Returns the literal for `false`
     fn false_literal(&mut self) -> Literal<Self>;
 
     /// Returns a reference to `PartialEq::<T,T>::eq`
index 17f43ad277c90eaf01afe284fad5ab791e8ceb06..8408e9c0c70e7c532d7af27e93d7b93aa6a876d1 100644 (file)
@@ -1819,7 +1819,7 @@ fn bar(foo: Foo) -> u32 {
 }
 ```
 
-Try using `{}` isntead:
+Try using `{}` instead:
 
 ```
 fn bar(foo: Foo) -> u32 {
@@ -2010,8 +2010,8 @@ fn bar(&self) { }
 some types will not implement `Clone`, and thus will not get this method.
 
 In our erroneous example, however, we're referencing a single concrete type.
-Since we know for certain that Wrapper<u32> implements Clone, there's no reason
-to also specify it in a `where` clause.
+Since we know for certain that `Wrapper<u32>` implements `Clone`, there's no
+reason to also specify it in a `where` clause.
 "##,
 
 E0194: r##"
@@ -2581,7 +2581,7 @@ fn do_something(x: Foo::Bar) { }
 do_something function. This is not legal: `Foo::Bar` is a value of type `Foo`,
 not a distinct static type. Likewise, it's not legal to attempt to
 `impl Foo::Bar`: instead, you must `impl Foo` and then pattern match to specify
-behaviour for specific enum variants.
+behavior for specific enum variants.
 "##,
 
 E0249: r##"