File tree Expand file tree Collapse file tree 3 files changed +4
-0
lines changed Expand file tree Collapse file tree 3 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,7 @@ pub trait IntoRawFd {
138138 /// let raw_fd: RawFd = f.into_raw_fd();
139139 /// # Ok::<(), io::Error>(())
140140 /// ```
141+ #[ must_use = "losing the raw file descriptor may leak resources" ]
141142 #[ stable( feature = "into_raw_os" , since = "1.4.0" ) ]
142143 fn into_raw_fd ( self ) -> RawFd ;
143144}
Original file line number Diff line number Diff line change @@ -347,6 +347,7 @@ pub trait IntoRawFd {
347347 /// This function **transfers ownership** of the underlying file descriptor
348348 /// to the caller. Callers are then the unique owners of the file descriptor
349349 /// and must close the descriptor once it's no longer needed.
350+ #[ must_use = "losing the raw file descriptor may leak resources" ]
350351 fn into_raw_fd ( self ) -> RawFd ;
351352}
352353
Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ pub trait IntoRawHandle {
8989 /// However, transferring ownership is not strictly required. Use a
9090 /// `Into<OwnedHandle>::into` implementation for an API which strictly
9191 /// transfers ownership.
92+ #[ must_use = "losing the raw handle may leak resources" ]
9293 #[ stable( feature = "into_raw_os" , since = "1.4.0" ) ]
9394 fn into_raw_handle ( self ) -> RawHandle ;
9495}
@@ -230,6 +231,7 @@ pub trait IntoRawSocket {
230231 /// However, transferring ownership is not strictly required. Use a
231232 /// `Into<OwnedSocket>::into` implementation for an API which strictly
232233 /// transfers ownership.
234+ #[ must_use = "losing the raw socket may leak resources" ]
233235 #[ stable( feature = "into_raw_os" , since = "1.4.0" ) ]
234236 fn into_raw_socket ( self ) -> RawSocket ;
235237}
You can’t perform that action at this time.
0 commit comments