Skip to content

Commit cac66e6

Browse files
committed
Add a note about why Padding requires T: Copy
1 parent 4c95aea commit cac66e6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/types.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ use crate::prelude::*;
66

77
/// A transparent wrapper over `MaybeUninit<T>` to represent uninitialized padding
88
/// while providing `Default`.
9+
// This is restricted to `Copy` types since that's a loose indicator that zeros is actually
10+
// a valid bitpattern. There is no technical reason this is required, though, so it could be
11+
// lifted in the future if it becomes a problem.
912
#[allow(unused)]
1013
#[repr(transparent)]
1114
#[derive(Clone, Copy)]

0 commit comments

Comments
 (0)