提交 6235e6f9 编写于 作者: E Eric Huss

Fix a few misspellings.

上级 f726dbe9
......@@ -3280,7 +3280,7 @@
///
/// In Rust 2021, one of the important introductions is the [prelude changes], which add
/// `TryFrom`, `TryInto`, and `FromIterator` into the standard library's prelude. Since this
/// results in an amiguity as to which method/function to call when an existing `try_into`
/// results in an ambiguity as to which method/function to call when an existing `try_into`
/// method is called via dot-call syntax or a `try_from`/`from_iter` associated function
/// is called directly on a type.
///
......
......@@ -3,7 +3,7 @@
impl<'a, K: 'a, V: 'a> NodeRef<marker::Mut<'a>, K, V, marker::LeafOrInternal> {
/// Stocks up a possibly underfull node by merging with or stealing from a
/// sibling. If succesful but at the cost of shrinking the parent node,
/// sibling. If successful but at the cost of shrinking the parent node,
/// returns that shrunk parent node. Returns an `Err` if the node is
/// an empty root.
fn fix_node_through_parent(
......
......@@ -167,7 +167,7 @@ unsafe fn new() -> Box<Self> {
/// carry a lifetime, because we want it to return `&'a` references.
/// Therefore, we define it only for the least powerful type `Immut<'a>`.
/// - We cannot get implicit coercion from say `Mut<'a>` to `Immut<'a>`.
/// Therefore, we have to explicitly call `reborrow` on a more powerfull
/// Therefore, we have to explicitly call `reborrow` on a more powerful
/// `NodeRef` in order to reach a method like `into_kv`.
///
/// All methods on `NodeRef` that return some kind of reference, either:
......
......@@ -41,7 +41,7 @@
///
/// If [`PartialOrd`] or [`Ord`] are also implemented for `Self` and `Rhs`, their methods must also
/// be consistent with `PartialEq` (see the documentation of those traits for the exact
/// requirememts). It's easy to accidentally make them disagree by deriving some of the traits and
/// requirements). It's easy to accidentally make them disagree by deriving some of the traits and
/// manually implementing others.
///
/// The equality relation `==` must satisfy the following conditions
......
......@@ -54,7 +54,7 @@
#[unstable(feature = "iter_zip", issue = "83574")]
pub use self::zip::zip;
/// This trait provides transitive access to source-stage in an interator-adapter pipeline
/// This trait provides transitive access to source-stage in an iterator-adapter pipeline
/// under the conditions that
/// * the iterator source `S` itself implements `SourceIter<Source = S>`
/// * there is a delegating implementation of this trait for each adapter in the pipeline between
......
......@@ -980,7 +980,7 @@ pub const fn slice_as_mut_ptr(this: &mut [MaybeUninit<T>]) -> *mut T {
this.as_mut_ptr() as *mut T
}
/// Copies the elements from `src` to `this`, returning a mutable reference to the now initalized contents of `this`.
/// Copies the elements from `src` to `this`, returning a mutable reference to the now initialized contents of `this`.
///
/// If `T` does not implement `Copy`, use [`write_slice_cloned`]
///
......@@ -1033,12 +1033,12 @@ pub fn write_slice<'a>(this: &'a mut [MaybeUninit<T>], src: &[T]) -> &'a mut [T]
this.copy_from_slice(uninit_src);
// SAFETY: Valid elements have just been copied into `this` so it is initalized
// SAFETY: Valid elements have just been copied into `this` so it is initialized
unsafe { MaybeUninit::slice_assume_init_mut(this) }
}
/// Clones the elements from `src` to `this`, returning a mutable reference to the now initalized contents of `this`.
/// Any already initalized elements will not be dropped.
/// Clones the elements from `src` to `this`, returning a mutable reference to the now initialized contents of `this`.
/// Any already initialized elements will not be dropped.
///
/// If `T` implements `Copy`, use [`write_slice`]
///
......@@ -1124,7 +1124,7 @@ fn drop(&mut self) {
super::forget(guard);
// SAFETY: Valid elements have just been written into `this` so it is initalized
// SAFETY: Valid elements have just been written into `this` so it is initialized
unsafe { MaybeUninit::slice_assume_init_mut(this) }
}
}
......@@ -101,7 +101,7 @@ pub const fn metadata<T: ?Sized>(ptr: *const T) -> <T as Pointee>::Metadata {
///
/// This function is safe but the returned pointer is not necessarily safe to dereference.
/// For slices, see the documentation of [`slice::from_raw_parts`] for safety requirements.
/// For trait objects, the metadata must come from a pointer to the same underlying ereased type.
/// For trait objects, the metadata must come from a pointer to the same underlying erased type.
///
/// [`slice::from_raw_parts`]: crate::slice::from_raw_parts
#[unstable(feature = "ptr_metadata", issue = "81513")]
......
......@@ -246,7 +246,7 @@ fn decode(r: &mut Reader<'_>, s: &mut S) -> Self {
}
}
/// Simplied version of panic payloads, ignoring
/// Simplified version of panic payloads, ignoring
/// types other than `&'static str` and `String`.
pub enum PanicMessage {
StaticStr(&'static str),
......
......@@ -971,7 +971,7 @@ mod match_keyword {}
/// ```
///
/// Like [`struct`]s and [`enum`]s, a module and its content are private by
/// default, unaccessible to code outside of the module.
/// default, inaccessible to code outside of the module.
///
/// To learn more about allowing access, see the documentation for the [`pub`]
/// keyword.
......
......@@ -226,7 +226,7 @@ pub trait ExitStatusExt: Sealed {
///
/// Panics on an attempt to make an `ExitStatusError` from a wait status of `0`.
///
/// Making an `ExitStatus` always succeds and never panics.
/// Making an `ExitStatus` always succeeds and never panics.
#[stable(feature = "exit_status_from", since = "1.12.0")]
fn from_raw(raw: i32) -> Self;
......
......@@ -1568,7 +1568,7 @@ pub fn code(&self) -> Option<i32> {
/// Reports the exit code, if applicable, from an `ExitStatusError`, as a `NonZero`
///
/// This is exaclty like [`code()`](Self::code), except that it returns a `NonZeroI32`.
/// This is exactly like [`code()`](Self::code), except that it returns a `NonZeroI32`.
///
/// Plain `code`, returning a plain integer, is provided because is is often more convenient.
/// The returned value from `code()` is indeed also nonzero; use `code_nonzero()` when you want
......
......@@ -14,7 +14,7 @@
/// This structure behaves a lot like a common mutex. There are some differences:
///
/// - By using busy waiting, it can be used outside the runtime.
/// - It is a so called ticket lock and is completly fair.
/// - It is a so called ticket lock and is completely fair.
#[cfg_attr(target_arch = "x86_64", repr(align(128)))]
#[cfg_attr(not(target_arch = "x86_64"), repr(align(64)))]
struct Spinlock<T: ?Sized> {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册