From 5a442437c8ab6d0cc11178c65cd5140d45d67d35 Mon Sep 17 00:00:00 2001 From: Samuel Selleck Date: Fri, 29 Sep 2023 14:53:46 -0700 Subject: [PATCH] Update references to issue #61 to issue #429 --- src/lib.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index cbd5a11a92..6d533b8827 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -600,7 +600,7 @@ impl_known_layout!(const N: usize, T => [T; N]); safety_comment! { /// SAFETY: - // TODO(#61): Add reference to docs + quotes + // TODO(#429): Add reference to docs + quotes /// `str` and `ManuallyDrop<[T]>` have the same representations as `[u8]` /// and `[T]` repsectively. `str` has different bit validity than `[u8]`, /// but that doesn't affect the soundness of this impl. @@ -705,7 +705,7 @@ pub unsafe trait FromZeroes { let slf: *mut Self = self; let len = mem::size_of_val(self); // SAFETY: - // TODO(#61): Add reference to docs + quotes + // TODO(#429): Add reference to docs + quotes // - `self` is guaranteed by the type system to be valid for writes of // size `size_of_val(self)`. // - `u8`'s alignment is 1, and thus `self` is guaranteed to be aligned @@ -1093,7 +1093,7 @@ pub unsafe trait AsBytes { let slf: *const Self = self; // SAFETY: - // TODO(#61): Add reference to docs + quotes + // TODO(#429): Add reference to docs + quotes // - `slf.cast::()` is valid for reads for `len * // mem::size_of::()` many bytes because... // - `slf` is the same pointer as `self`, and `self` is a reference @@ -1234,7 +1234,7 @@ safety_comment! { safety_comment! { /// SAFETY: - /// TODO(#61): Add quotes + /// TODO(#429): Add quotes /// - `FromZeroes`, `FromBytes`: all bit patterns are valid for integers [1] /// - `AsBytes`: integers have no padding bytes [1] /// - `Unaligned` (`u8` and `i8` only): The reference [2] specifies the size @@ -1270,8 +1270,8 @@ safety_comment! { /// - `AsBytes`: the `{f32,f64}::to_bits` methods' documentation [4,5] /// states that they are currently equivalent to `transmute`. [3] /// - /// TODO(#61): Make these arguments more precisely in terms of the documentation - /// TODO(#61): Add quotes + /// TODO(#429): Make these arguments more precisely in terms of the documentation + /// TODO(#429): Add quotes /// /// [1] https://doc.rust-lang.org/nightly/std/primitive.f32.html#method.from_bits /// [2] https://doc.rust-lang.org/nightly/std/primitive.f64.html#method.from_bits @@ -1313,7 +1313,7 @@ safety_comment! { } safety_comment! { /// SAFETY: - /// TODO(#61): Add quotes + /// TODO(#429): Add quotes /// - `FromZeroes`, `AsBytes`, `Unaligned`: Per the reference [1], `str` has /// the same layout as `[u8]`, and `[u8]` is `FromZeroes`, `AsBytes`, and /// `Unaligned`. @@ -1329,7 +1329,7 @@ safety_comment! { // `NonZeroXxx` is `AsBytes`, but not `FromZeroes` or `FromBytes`. // /// SAFETY: - /// TODO(#61): Add quotes + /// TODO(#429): Add quotes /// - `AsBytes`: `NonZeroXxx` has the same layout as its associated /// primitive. Since it is the same size, this guarantees it has no /// padding - integers have no padding, and there's no room for padding @@ -1364,7 +1364,7 @@ safety_comment! { } safety_comment! { /// SAFETY: - /// TODO(#61): Add quotes + /// TODO(#429): Add quotes /// - `FromZeroes`, `FromBytes`, `AsBytes`: The Rust compiler reuses `0` /// value to represent `None`, so `size_of::>() == /// size_of::()`; see `NonZeroXxx` documentation. @@ -1418,7 +1418,7 @@ safety_comment! { } safety_comment! { /// SAFETY: - /// TODO(#61): Add quotes + /// TODO(#429): Add quotes /// `Wrapping` is guaranteed by its docs [1] to have the same layout as /// `T`. Also, `Wrapping` is `#[repr(transparent)]`, and has a single /// field, which is `pub`. Per the reference [2], this means that the @@ -1460,7 +1460,7 @@ safety_comment! { } safety_comment! { /// SAFETY: - // TODO(#61): Add reference to docs + quotes + // TODO(#429): Add reference to docs + quotes /// `ManuallyDrop` has the same layout as `T`, and accessing the inner value /// is safe (meaning that it's unsound to leave the inner value /// uninitialized while exposing the `ManuallyDrop` to safe code).