Skip to content

Commit

Permalink
Added safety comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
Frostie314159 committed Dec 18, 2023
1 parent df0362b commit d555e3b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,8 @@ impl<'a, Ctx: Copy, T: TryFromCtx<'a, Ctx, Error = error::Error>, const N: usize
}
if let Some((e, idx)) = error_ctx {
for element in &mut buf[0..idx].iter_mut() {
// SAFETY: Any element upto idx must have already been initialized, since
// we iterate until we encounter an error.
unsafe {
element.assume_init_drop();
}
Expand Down

0 comments on commit d555e3b

Please sign in to comment.