Skip to content

Commit d81ddc8

Browse files
authored
clarify safety comments in Drop impl
1 parent f85d006 commit d81ddc8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libs/maintaining-std.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ struct OptionCell<T> {
202202
impl<T> Drop for OptionCell<T> {
203203
fn drop(&mut self) {
204204
if self.is_init {
205+
// Safety: `value` is guaranteed to be fully initialized when `is_init` is true.
205206
// Safety: The cell is being dropped, so it can't be accessed again.
206207
drop(unsafe { self.value.read() });
207208
}

0 commit comments

Comments
 (0)