Skip to content

Commit

Permalink
Update references to issue google#61 to issue google#429
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelselleck committed Sep 29, 2023
1 parent 49270e7 commit 5a44243
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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::<u8>()` is valid for reads for `len *
// mem::size_of::<u8>()` many bytes because...
// - `slf` is the same pointer as `self`, and `self` is a reference
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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`.
Expand All @@ -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
Expand Down Expand Up @@ -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::<Option<NonZeroXxx>>() ==
/// size_of::<xxx>()`; see `NonZeroXxx` documentation.
Expand Down Expand Up @@ -1418,7 +1418,7 @@ safety_comment! {
}
safety_comment! {
/// SAFETY:
/// TODO(#61): Add quotes
/// TODO(#429): Add quotes
/// `Wrapping<T>` is guaranteed by its docs [1] to have the same layout as
/// `T`. Also, `Wrapping<T>` is `#[repr(transparent)]`, and has a single
/// field, which is `pub`. Per the reference [2], this means that the
Expand Down Expand Up @@ -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).
Expand Down

0 comments on commit 5a44243

Please sign in to comment.