Skip to content

Commit cbe49f7

Browse files
committed
windows: Mark notify_completion() as unsafe
The soundness of this method relies on a valid object being passed in.
1 parent 91e5642 commit cbe49f7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/platform/windows/mod.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,11 @@ impl MessageReader {
449449
}
450450

451451
/// Called when we receive an IO Completion Packet for this handle.
452-
fn notify_completion(&mut self, err: u32) -> Result<(),WinError> {
452+
///
453+
/// Unsafe, since as far as I can tell, the soundness of this method
454+
/// relies on the validity of the `self` object (specifically, `self.ov`)
455+
/// passed in by the caller.
456+
unsafe fn notify_completion(&mut self, err: u32) -> Result<(),WinError> {
453457
win32_trace!("[$ {:?}] notify_completion", self.handle);
454458

455459
// mark a read as no longer in progress even before we check errors

0 commit comments

Comments
 (0)