]> git.lizzy.rs Git - rust.git/blobdiff - src/libcore/mem.rs
Auto merge of #28957 - GuillaumeGomez:patch-5, r=Manishearth
[rust.git] / src / libcore / mem.rs
index 193b8d6d620de46dcd17c85e5bc0d80e81fb5acf..a87d135e42592551f518118a93969ca1ad6e436a 100644 (file)
@@ -37,7 +37,7 @@
 /// * You have two copies of a value (like when writing something like
 ///   [`mem::swap`][swap]), but need the destructor to only run once to
 ///   prevent a double `free`.
-/// * Transferring resources across [FFI][ffi] boundries.
+/// * Transferring resources across [FFI][ffi] boundaries.
 ///
 /// [swap]: fn.swap.html
 /// [ffi]: ../../book/ffi.html
@@ -264,9 +264,9 @@ unsafe fn dropped_impl<T>() -> T { intrinsics::init_dropped() }
 /// This is useful for FFI functions and initializing arrays sometimes,
 /// but should generally be avoided.
 ///
-/// # Undefined Behaviour
+/// # Undefined Behavior
 ///
-/// It is Undefined Behaviour to read uninitialized memory. Even just an
+/// It is Undefined Behavior to read uninitialized memory. Even just an
 /// uninitialized boolean. For instance, if you branch on the value of such
 /// a boolean your program may take one, both, or neither of the branches.
 ///
@@ -303,7 +303,7 @@ unsafe fn dropped_impl<T>() -> T { intrinsics::init_dropped() }
 ///
 ///     // DANGER ZONE: if anything panics or otherwise
 ///     // incorrectly reads the array here, we will have
-///     // Undefined Behaviour.
+///     // Undefined Behavior.
 ///
 ///     // It's ok to mutably iterate the data, since this
 ///     // doesn't involve reading it at all.
@@ -340,7 +340,7 @@ pub unsafe fn uninitialized<T>() -> T {
     intrinsics::uninit()
 }
 
-/// Swap the values at two mutable locations of the same type, without deinitialising or copying
+/// Swap the values at two mutable locations of the same type, without deinitializing or copying
 /// either one.
 ///
 /// # Examples
@@ -376,7 +376,7 @@ pub fn swap<T>(x: &mut T, y: &mut T) {
 }
 
 /// Replaces the value at a mutable location with a new one, returning the old value, without
-/// deinitialising or copying either one.
+/// deinitializing or copying either one.
 ///
 /// This is primarily used for transferring and swapping ownership of a value in a mutable
 /// location.