Skip to content

Commit 27aea67

Browse files
authored
Clean up one TODO, enable more Clippy lints (#179)
1 parent 59e60d3 commit 27aea67

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/lib.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
clippy::decimal_literal_representation,
9494
clippy::get_unwrap,
9595
clippy::indexing_slicing,
96+
clippy::missing_safety_doc,
9697
clippy::obfuscated_if_else,
9798
clippy::perf,
9899
clippy::print_stdout,
@@ -901,19 +902,15 @@ safety_comment! {
901902

902903
safety_comment! {
903904
/// SAFETY:
904-
/// The reference [1] suggests (but does not clearly promise) that
905-
/// `PhantomData` has size 0 and alignment 1.
905+
/// For all `T`, `PhantomData<T>` has size 0 and alignment 1. [1]
906906
/// - `FromZeroes`, `FromBytes`: There is only one possible sequence of 0
907907
/// bytes, and `PhantomData` is inhabited.
908908
/// - `AsBytes`: Since `PhantomData` has size 0, it contains no padding
909909
/// bytes.
910910
/// - `Unaligned`: Per the preceding reference, `PhantomData` has alignment
911911
/// 1.
912912
///
913-
/// [1] https://doc.rust-lang.org/reference/type-layout.html#the-transparent-representation
914-
///
915-
/// TODO(https://github.com/rust-lang/rust/pull/104081): Cite guaranteed
916-
/// size and alignment.
913+
/// [1] https://doc.rust-lang.org/std/marker/struct.PhantomData.html#layout-1
917914
unsafe_impl!(T: ?Sized => FromZeroes for PhantomData<T>);
918915
unsafe_impl!(T: ?Sized => FromBytes for PhantomData<T>);
919916
unsafe_impl!(T: ?Sized => AsBytes for PhantomData<T>);

zerocopy-derive/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// our MSRV.
1313
#![allow(unknown_lints)]
1414
#![deny(renamed_and_removed_lints)]
15-
#![deny(clippy::all)]
15+
#![deny(clippy::all, clippy::missing_safety_doc)]
1616
#![deny(
1717
rustdoc::bare_urls,
1818
rustdoc::broken_intra_doc_links,

0 commit comments

Comments
 (0)