Remove obsolete safety asserts

These will cause spurious panics once
https://github.com/rust-lang/rust/pull/78802 is merged.

(cherry picked from commit 9287a34d63)
This commit is contained in:
Benjamin Saunders
2021-03-02 21:29:02 -08:00
committed by Dirkjan Ochtman
parent d799cbed61
commit 811a28e01f
+1 -11
View File
@@ -2,7 +2,7 @@ use std::{
io,
io::IoSliceMut,
mem::{self, MaybeUninit},
net::{IpAddr, SocketAddr, SocketAddrV4, SocketAddrV6},
net::{IpAddr, SocketAddr},
os::unix::io::AsRawFd,
ptr,
task::{Context, Poll},
@@ -73,16 +73,6 @@ impl UdpSocket {
}
fn init(io: &mio::net::UdpSocket) -> io::Result<()> {
// Safety
assert_eq!(
mem::size_of::<SocketAddrV4>(),
mem::size_of::<libc::sockaddr_in>()
);
assert_eq!(
mem::size_of::<SocketAddrV6>(),
mem::size_of::<libc::sockaddr_in6>()
);
let mut cmsg_platform_space = 0;
if cfg!(target_os = "linux") {
cmsg_platform_space +=