Make os/windows default to deny unsafe in unsafe ยท model-checking/verify-rust-std@3c286d5 (original) (raw)
`@@ -159,10 +159,12 @@ fn stdio_handle(raw: RawHandle) -> RawHandle {
`
159
159
`impl FromRawHandle for fs::File {
`
160
160
`#[inline]
`
161
161
`unsafe fn from_raw_handle(handle: RawHandle) -> fs::File {
`
162
``
`-
let handle = handle as sys::c::HANDLE;
`
163
``
`-
fs::File::from_inner(sys::fs::File::from_inner(FromInner::from_inner(
`
164
``
`-
OwnedHandle::from_raw_handle(handle),
`
165
``
`-
)))
`
``
162
`+
unsafe {
`
``
163
`+
let handle = handle as sys::c::HANDLE;
`
``
164
`+
fs::File::from_inner(sys::fs::File::from_inner(FromInner::from_inner(
`
``
165
`+
OwnedHandle::from_raw_handle(handle),
`
``
166
`+
)))
`
``
167
`+
}
`
166
168
`}
`
167
169
`}
`
168
170
``
`@@ -260,24 +262,30 @@ impl AsRawSocket for net::UdpSocket {
`
260
262
`impl FromRawSocket for net::TcpStream {
`
261
263
`#[inline]
`
262
264
`unsafe fn from_raw_socket(sock: RawSocket) -> net::TcpStream {
`
263
``
`-
let sock = sys:๐ฅ :Socket::from_inner(OwnedSocket::from_raw_socket(sock));
`
264
``
`-
net::TcpStream::from_inner(sys_common:๐ฅ :TcpStream::from_inner(sock))
`
``
265
`+
unsafe {
`
``
266
`+
let sock = sys:๐ฅ :Socket::from_inner(OwnedSocket::from_raw_socket(sock));
`
``
267
`+
net::TcpStream::from_inner(sys_common:๐ฅ :TcpStream::from_inner(sock))
`
``
268
`+
}
`
265
269
`}
`
266
270
`}
`
267
271
`#[stable(feature = "from_raw_os", since = "1.1.0")]
`
268
272
`impl FromRawSocket for net::TcpListener {
`
269
273
`#[inline]
`
270
274
`unsafe fn from_raw_socket(sock: RawSocket) -> net::TcpListener {
`
271
``
`-
let sock = sys:๐ฅ :Socket::from_inner(OwnedSocket::from_raw_socket(sock));
`
272
``
`-
net::TcpListener::from_inner(sys_common:๐ฅ :TcpListener::from_inner(sock))
`
``
275
`+
unsafe {
`
``
276
`+
let sock = sys:๐ฅ :Socket::from_inner(OwnedSocket::from_raw_socket(sock));
`
``
277
`+
net::TcpListener::from_inner(sys_common:๐ฅ :TcpListener::from_inner(sock))
`
``
278
`+
}
`
273
279
`}
`
274
280
`}
`
275
281
`#[stable(feature = "from_raw_os", since = "1.1.0")]
`
276
282
`impl FromRawSocket for net::UdpSocket {
`
277
283
`#[inline]
`
278
284
`unsafe fn from_raw_socket(sock: RawSocket) -> net::UdpSocket {
`
279
``
`-
let sock = sys:๐ฅ :Socket::from_inner(OwnedSocket::from_raw_socket(sock));
`
280
``
`-
net::UdpSocket::from_inner(sys_common:๐ฅ :UdpSocket::from_inner(sock))
`
``
285
`+
unsafe {
`
``
286
`+
let sock = sys:๐ฅ :Socket::from_inner(OwnedSocket::from_raw_socket(sock));
`
``
287
`+
net::UdpSocket::from_inner(sys_common:๐ฅ :UdpSocket::from_inner(sock))
`
``
288
`+
}
`
281
289
`}
`
282
290
`}
`
283
291
``