We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a4be496 commit 410a30eCopy full SHA for 410a30e
src/internals/cast.rs
@@ -10,13 +10,16 @@ pub struct BytesAsReparseDataBuffer {
10
value: Box<[MaybeU8; MAXIMUM_REPARSE_DATA_BUFFER_SIZE as usize]>,
11
}
12
13
+// Asserts that pointers of `BytesAsReparseDataBuffer` can be casted to
14
+// `REPARSE_DATA_BUFFER`.
15
const _: () = {
16
let a = align_of::<BytesAsReparseDataBuffer>();
17
let b = align_of::<REPARSE_DATA_BUFFER>();
- [(); 1][!((a % b) == 0) as usize]
18
+ assert!((a % b) == 0);
19
};
20
21
impl BytesAsReparseDataBuffer {
22
+ // MSRV(1.82): Use `Box::new_uninit_slice` instead.
23
pub fn new() -> Self {
24
type Raw = [MaybeU8; MAXIMUM_REPARSE_DATA_BUFFER_SIZE as usize];
25
const LAYOUT: Layout = Layout::new::<Raw>();
0 commit comments