Skip to content

Commit 458f216

Browse files
authored
Fix spelling in documentation (#2733)
1 parent ded35ce commit 458f216

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ where
249249
pub struct AlignmentError<Src, Dst: ?Sized> {
250250
/// The source value involved in the conversion.
251251
src: Src,
252-
/// The inner destination type inolved in the conversion.
252+
/// The inner destination type involved in the conversion.
253253
///
254254
/// INVARIANT: An `AlignmentError` may only be constructed if `Dst`'s
255255
/// alignment requirement is greater than one.

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ use {FromZeros as FromZeroes, IntoBytes as AsBytes, Ref as LayoutVerified};
630630
/// example.
631631
///
632632
/// A `#[repr(C)]` slice DST is laid out [just like sized `#[repr(C)]`
633-
/// types][repr-c-structs], but the presenence of a variable-length field
633+
/// types][repr-c-structs], but the presence of a variable-length field
634634
/// introduces the possibility of *dynamic padding*. In particular, it may be
635635
/// necessary to add trailing padding *after* the trailing slice field in order
636636
/// to satisfy the outer type's alignment, and the amount of padding required
@@ -1446,7 +1446,7 @@ pub use zerocopy_derive::TryFromBytes;
14461446
/// definitely invalid.
14471447
///
14481448
/// Zerocopy takes a conservative approach, and only considers a bit pattern to
1449-
/// be valid if its validity is a documenteed guarantee provided by the
1449+
/// be valid if its validity is a documented guarantee provided by the
14501450
/// language.
14511451
///
14521452
/// For most use cases, Rust's current guarantees align with programmers'

src/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ macro_rules! transmute {
101101
dst: ManuallyDrop<Dst>,
102102
}
103103

104-
// SAFETY: `Transmute` is a `reper(C)` union whose `src` field has
104+
// SAFETY: `Transmute` is a `repr(C)` union whose `src` field has
105105
// type `ManuallyDrop<Src>`. Thus, the `src` field starts at byte
106106
// offset 0 within `Transmute` [1]. `ManuallyDrop<T>` has the same
107107
// layout and bit validity as `T`, so it is sound to transmute `Src`

src/pointer/ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ mod _transitions {
815815
// contains a bit-valid instance of `T`. By `T:
816816
// TryTransmuteFromPtr<T, I::Aliasing, I::Validity, Valid>`, so
817817
// long as `self`'s referent conforms to the `Valid` validity
818-
// for `T` (which we just confired), then this transmute is
818+
// for `T` (which we just confirmed), then this transmute is
819819
// sound.
820820
Ok(unsafe { self.assume_valid() })
821821
} else {

src/ref.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ where
717717
let b = unsafe { r.as_byte_slice() };
718718

719719
// SAFETY: By postcondition on `as_byte_slice`, we know that `b` is a
720-
// valid size and ailgnment for `T`. By safety invariant on `ByteSlice`,
720+
// valid size and alignment for `T`. By safety invariant on `ByteSlice`,
721721
// we know that this is preserved via `.deref()`. Because `T:
722722
// FromBytes`, it is sound to interpret these bytes as a `T`.
723723
unsafe { ptr::read(b.deref().as_ptr().cast::<T>()) }
@@ -741,7 +741,7 @@ where
741741
let b = unsafe { r.as_byte_slice_mut() };
742742

743743
// SAFETY: By postcondition on `as_byte_slice_mut`, we know that `b` is
744-
// a valid size and ailgnment for `T`. By safety invariant on
744+
// a valid size and alignment for `T`. By safety invariant on
745745
// `ByteSlice`, we know that this is preserved via `.deref()`. Writing
746746
// `t` to the buffer will allow all of the bytes of `t` to be accessed
747747
// as a `[u8]`, but because `T: IntoBytes`, we know that this is sound.

src/util/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ pub(crate) const unsafe fn transmute_unchecked<Src, Dst>(src: Src) -> Dst {
281281
// SAFETY: Since `Transmute<Src, Dst>` is `#[repr(C)]`, its `src` and `dst`
282282
// fields both start at the same offset and the types of those fields are
283283
// transparent wrappers around `Src` and `Dst` [1]. Consequently,
284-
// initializng `Transmute` with with `src` and then reading out `dst` is
284+
// initializing `Transmute` with with `src` and then reading out `dst` is
285285
// equivalent to transmuting from `Src` to `Dst` [2]. Transmuting from `src`
286286
// to `Dst` is valid because — by contract on the caller — `src` is a valid
287287
// instance of `Dst`.

0 commit comments

Comments
 (0)