diff --git a/src/liballoc/allocator.rs b/src/liballoc/allocator.rs index fc6585a9f951d6d58c6bb29dbe27ee5eed5eb1b4..f14f27023249e3423cbba1cdab383d6b65a7a71c 100644 --- a/src/liballoc/allocator.rs +++ b/src/liballoc/allocator.rs @@ -110,7 +110,7 @@ pub fn from_size_align(size: usize, align: usize) -> Option { /// Creates a layout, bypassing all checks. /// - /// # Unsafety + /// # Safety /// /// This function is unsafe as it does not verify that `align` is /// a power-of-two that is also less than or equal to 2^31, nor @@ -485,7 +485,7 @@ pub unsafe trait Alloc { /// behavior, e.g. to ensure initialization to particular sets of /// bit patterns.) /// - /// # Unsafety + /// # Safety /// /// This function is unsafe because undefined behavior can result /// if the caller does not ensure that `layout` has non-zero size. @@ -513,7 +513,7 @@ pub unsafe trait Alloc { /// Deallocate the memory referenced by `ptr`. /// - /// # Unsafety + /// # Safety /// /// This function is unsafe because undefined behavior can result /// if the caller does not ensure all of the following: @@ -617,7 +617,7 @@ fn usable_size(&self, layout: &Layout) -> (usize, usize) { /// behavior is well-defined (though underspecified) when this /// constraint is violated; further discussion below. /// - /// # Unsafety + /// # Safety /// /// This function is unsafe because undefined behavior can result /// if the caller does not ensure all of the following: @@ -688,7 +688,7 @@ unsafe fn realloc(&mut self, /// Behaves like `alloc`, but also ensures that the contents /// are set to zero before being returned. /// - /// # Unsafety + /// # Safety /// /// This function is unsafe for the same reasons that `alloc` is. /// @@ -714,7 +714,7 @@ unsafe fn alloc_zeroed(&mut self, layout: Layout) -> Result<*mut u8, AllocErr> { /// the returned block. For some `layout` inputs, like arrays, this /// may include extra storage usable for additional data. /// - /// # Unsafety + /// # Safety /// /// This function is unsafe for the same reasons that `alloc` is. /// @@ -736,7 +736,7 @@ unsafe fn alloc_excess(&mut self, layout: Layout) -> Result { /// the returned block. For some `layout` inputs, like arrays, this /// may include extra storage usable for additional data. /// - /// # Unsafety + /// # Safety /// /// This function is unsafe for the same reasons that `realloc` is. /// @@ -770,7 +770,7 @@ unsafe fn realloc_excess(&mut self, /// memory block referenced by `ptr` has not been transferred, and /// the contents of the memory block are unaltered. /// - /// # Unsafety + /// # Safety /// /// This function is unsafe because undefined behavior can result /// if the caller does not ensure all of the following: @@ -827,7 +827,7 @@ unsafe fn grow_in_place(&mut self, /// the memory block has not been transferred, and the contents of /// the memory block are unaltered. /// - /// # Unsafety + /// # Safety /// /// This function is unsafe because undefined behavior can result /// if the caller does not ensure all of the following: @@ -920,7 +920,7 @@ fn alloc_one(&mut self) -> Result, AllocErr> /// /// Captures a common usage pattern for allocators. /// - /// # Unsafety + /// # Safety /// /// This function is unsafe because undefined behavior can result /// if the caller does not ensure both: @@ -993,7 +993,7 @@ fn alloc_array(&mut self, n: usize) -> Result, AllocErr> /// The returned block is suitable for passing to the /// `alloc`/`realloc` methods of this allocator. /// - /// # Unsafety + /// # Safety /// /// This function is unsafe because undefined behavior can result /// if the caller does not ensure all of the following: @@ -1037,7 +1037,7 @@ unsafe fn realloc_array(&mut self, /// /// Captures a common usage pattern for allocators. /// - /// # Unsafety + /// # Safety /// /// This function is unsafe because undefined behavior can result /// if the caller does not ensure both: diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index c0d43d9c52755d3086c480ff23dff7222d546bee..82aac4dbf63346fa2897e215df8b329faf34a7ee 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -633,7 +633,7 @@ impl FusedIterator for Box {} /// that `FnBox` may be deprecated in the future if `Box` /// closures become directly usable.) /// -/// ### Example +/// # Examples /// /// Here is a snippet of code which creates a hashmap full of boxed /// once closures and then removes them one by one, calling each diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index 356ca7a5f5e0cee6adf9372629a330b886cc3774..fd60e8aaded48aa2a2697d07bfc3ae900dda10d3 100644 --- a/src/liballoc/slice.rs +++ b/src/liballoc/slice.rs @@ -171,7 +171,7 @@ pub fn to_vec(s: &[T]) -> Vec impl [T] { /// Returns the number of elements in the slice. /// - /// # Example + /// # Examples /// /// ``` /// let a = [1, 2, 3]; @@ -185,7 +185,7 @@ pub fn len(&self) -> usize { /// Returns `true` if the slice has a length of 0. /// - /// # Example + /// # Examples /// /// ``` /// let a = [1, 2, 3]; @@ -523,7 +523,7 @@ pub fn swap(&mut self, a: usize, b: usize) { /// Reverses the order of elements in the slice, in place. /// - /// # Example + /// # Examples /// /// ``` /// let mut v = [1, 2, 3]; @@ -580,7 +580,7 @@ pub fn iter_mut(&mut self) -> IterMut { /// /// Panics if `size` is 0. /// - /// # Example + /// # Examples /// /// ``` /// let slice = ['r', 'u', 's', 't']; @@ -613,7 +613,7 @@ pub fn windows(&self, size: usize) -> Windows { /// /// Panics if `size` is 0. /// - /// # Example + /// # Examples /// /// ``` /// let slice = ['l', 'o', 'r', 'e', 'm']; @@ -1040,7 +1040,7 @@ pub fn ends_with(&self, needle: &[T]) -> bool /// `Err` is returned, containing the index where a matching /// element could be inserted while maintaining sorted order. /// - /// # Example + /// # Examples /// /// Looks up a series of four elements. The first is found, with a /// uniquely determined position; the second and third are not @@ -1074,7 +1074,7 @@ pub fn binary_search(&self, x: &T) -> Result /// `Err` is returned, containing the index where a matching /// element could be inserted while maintaining sorted order. /// - /// # Example + /// # Examples /// /// Looks up a series of four elements. The first is found, with a /// uniquely determined position; the second and third are not @@ -1419,7 +1419,7 @@ pub fn rotate(&mut self, mid: usize) { /// /// This function will panic if the two slices have different lengths. /// - /// # Example + /// # Examples /// /// ``` /// let mut dst = [0, 0, 0]; @@ -1445,7 +1445,7 @@ pub fn clone_from_slice(&mut self, src: &[T]) where T: Clone { /// /// This function will panic if the two slices have different lengths. /// - /// # Example + /// # Examples /// /// ``` /// let mut dst = [0, 0, 0]; diff --git a/src/liballoc/str.rs b/src/liballoc/str.rs index 80317cd763b5c8680e6b5d5dc6d51fce0ea87e98..79b2bbce2af7cf13e59ad095572ce3a4e6b2d54a 100644 --- a/src/liballoc/str.rs +++ b/src/liballoc/str.rs @@ -1714,7 +1714,7 @@ pub fn trim_right_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str /// /// [`Err`]: str/trait.FromStr.html#associatedtype.Err /// - /// # Example + /// # Examples /// /// Basic usage /// diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index dc0905e297251f86c5c6161ef69501ff6248aa23..e0a3b8d52f40efb5df9180a1b741928196675fed 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -998,7 +998,7 @@ pub fn clone(orig: &Ref<'b, T>) -> Ref<'b, T> { /// A method would interfere with methods of the same name on the contents /// of a `RefCell` used through `Deref`. /// - /// # Example + /// # Examples /// /// ``` /// use std::cell::{RefCell, Ref}; @@ -1040,7 +1040,7 @@ impl<'b, T: ?Sized> RefMut<'b, T> { /// `RefMut::map(...)`. A method would interfere with methods of the same /// name on the contents of a `RefCell` used through `Deref`. /// - /// # Example + /// # Examples /// /// ``` /// use std::cell::{RefCell, RefMut}; diff --git a/src/libcore/fmt/builders.rs b/src/libcore/fmt/builders.rs index 8125097d7d1056573e82d36c7297e36af77a2053..b594c886b64f5d35a80a9ccd79b3836954d0f63e 100644 --- a/src/libcore/fmt/builders.rs +++ b/src/libcore/fmt/builders.rs @@ -58,7 +58,7 @@ fn write_str(&mut self, mut s: &str) -> fmt::Result { /// [`Formatter::debug_struct`](struct.Formatter.html#method.debug_struct) /// method. /// -/// # Example +/// # Examples /// /// ``` /// use std::fmt; @@ -153,7 +153,7 @@ fn is_pretty(&self) -> bool { /// [`Formatter::debug_tuple`](struct.Formatter.html#method.debug_tuple) /// method. /// -/// # Example +/// # Examples /// /// ``` /// use std::fmt; @@ -290,7 +290,7 @@ fn is_pretty(&self) -> bool { /// [`Formatter::debug_set`](struct.Formatter.html#method.debug_set) /// method. /// -/// # Example +/// # Examples /// /// ``` /// use std::fmt; @@ -361,7 +361,7 @@ pub fn finish(&mut self) -> fmt::Result { /// [`Formatter::debug_list`](struct.Formatter.html#method.debug_list) /// method. /// -/// # Example +/// # Examples /// /// ``` /// use std::fmt; @@ -432,7 +432,7 @@ pub fn finish(&mut self) -> fmt::Result { /// [`Formatter::debug_map`](struct.Formatter.html#method.debug_map) /// method. /// -/// # Example +/// # Examples /// /// ``` /// use std::fmt; diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index 6f7adbe1e7a0e9e67754ae9731582c4e209b4668..4b866cab1eae2f00b97e5d0af34240ec4fb21904 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -901,7 +901,7 @@ pub fn into_inner(slot: ManuallyDrop) -> T { /// Manually drops the contained value. /// - /// # Unsafety + /// # Safety /// /// This function runs the destructor of the contained value and thus the wrapped value /// now represents uninitialized data. It is up to the user of this method to ensure the diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 0fff833e7d83e2a9bc93f1fd07150a1a3cfe4278..074ab3ebd8fdca9b045f86672f04f093abf2704b 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -522,7 +522,7 @@ pub trait Read { /// `Read`er - the method only takes `&self` so that it can be used through /// trait objects. /// - /// # Unsafety + /// # Safety /// /// This method is unsafe because a `Read`er could otherwise return a /// non-zeroing `Initializer` from another `Read` type without an `unsafe` @@ -903,7 +903,7 @@ pub fn zeroing() -> Initializer { /// Returns a new `Initializer` which will not zero out buffers. /// - /// # Unsafety + /// # Safety /// /// This may only be called by `Read`ers which guarantee that they will not /// read from buffers passed to `Read` methods, and that the return value of diff --git a/src/libstd/memchr.rs b/src/libstd/memchr.rs index 98642f86f4dc22fc900d1addf902a4256880d7f0..240e82069ff4d64fbb0c72a33eb7a2fdd49d7672 100644 --- a/src/libstd/memchr.rs +++ b/src/libstd/memchr.rs @@ -20,7 +20,7 @@ /// magnitude faster than `haystack.iter().position(|&b| b == needle)`. /// (See benchmarks.) /// -/// # Example +/// # Examples /// /// This shows how to find the first position of a byte in a byte string. /// @@ -40,7 +40,7 @@ pub fn memchr(needle: u8, haystack: &[u8]) -> Option { /// Returns the index corresponding to the last occurrence of `needle` in /// `haystack`, or `None` if one is not found. /// -/// # Example +/// # Examples /// /// This shows how to find the last position of a byte in a byte string. /// diff --git a/src/libstd/sys/redox/ext/mod.rs b/src/libstd/sys/redox/ext/mod.rs index 259cda5bcb3ebe485d07f2cd5f8090e2ebf1b18a..9fd8d6c91869c07422eedf0c7f10deb008ed985c 100644 --- a/src/libstd/sys/redox/ext/mod.rs +++ b/src/libstd/sys/redox/ext/mod.rs @@ -13,7 +13,7 @@ //! For now, this module is limited to extracting file descriptors, //! but its functionality will grow over time. //! -//! # Example +//! # Examples //! //! ```no_run //! use std::fs::File; diff --git a/src/libstd/sys/unix/ext/mod.rs b/src/libstd/sys/unix/ext/mod.rs index 67fe46cc9c7a20326b6c8b4dec7726f8356128b6..98bc90dd4e13246694c14531affe2fd53cd47012 100644 --- a/src/libstd/sys/unix/ext/mod.rs +++ b/src/libstd/sys/unix/ext/mod.rs @@ -13,7 +13,7 @@ //! For now, this module is limited to extracting file descriptors, //! but its functionality will grow over time. //! -//! # Example +//! # Examples //! //! ```no_run //! use std::fs::File; diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index ee103c803f542b58d447bebd2322ca06341ec627..6354e746af26a35f46f8752145c377e4ff9da262 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -807,7 +807,7 @@ pub fn park_timeout_ms(ms: u32) { /// Platforms which do not support nanosecond precision for sleeping will have /// `dur` rounded up to the nearest granularity of time they can sleep for. /// -/// # Example +/// # Examples /// /// Waiting for the complete expiration of the timeout: ///