Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unsafe impl<'a> BufMut for ReadBuf<'a> #5590

Merged
merged 19 commits into from Apr 4, 2023
5 changes: 4 additions & 1 deletion tokio/src/io/read_buf.rs
Expand Up @@ -284,7 +284,10 @@ unsafe impl<'a> BufMut for ReadBuf<'a> {
}

fn chunk_mut(&mut self) -> &mut UninitSlice {
unsafe { UninitSlice::from_raw_parts_mut(10 as *mut u8, 10) }
let ptr = 10 as *mut u8; // any ideas?
amab8901 marked this conversation as resolved.
Show resolved Hide resolved
let len = self.filled().len();
amab8901 marked this conversation as resolved.
Show resolved Hide resolved
unsafe { UninitSlice::from_raw_parts_mut(ptr, len) }

}
}

Expand Down