We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 661df4f commit 58ea02eCopy full SHA for 58ea02e
library/core/src/iter/adapters/filter_map.rs
@@ -97,10 +97,11 @@ where
97
// SAFETY: Loop conditions ensure the index is in bounds.
98
99
unsafe {
100
- let opt_payload_at =
101
- (&val as *const Option<B>).byte_add(core::mem::offset_of!(Option<B>, Some.0));
+ let opt_payload_at: *const MaybeUninit<B> = (&val as *const Option<B>)
+ .byte_add(core::mem::offset_of!(Option<B>, Some.0))
102
+ .cast();
103
let dst = guard.array.as_mut_ptr().add(idx);
- crate::ptr::copy_nonoverlapping(opt_payload_at.cast(), dst, 1);
104
+ crate::ptr::copy_nonoverlapping(opt_payload_at, dst, 1);
105
crate::mem::forget(val);
106
};
107
0 commit comments