Skip to content

Commit 6d65379

Browse files
committed
clarify what you cannot do
1 parent 2cb9d3d commit 6d65379

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: library/std/src/io/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,9 @@
255255
//! The platform-specific parts of the Rust standard library expose types that reflect these
256256
//! concepts, see [`os::unix`] and [`os::windows`].
257257
//!
258-
//! To uphold I/O safety, it is crucial that no code acts on file descriptors it does not own. In
259-
//! other words, a safe function that takes a regular integer, treats it as a file descriptor, and
260-
//! acts on it, is *unsound*.
258+
//! To uphold I/O safety, it is crucial that no code acts on file descriptors it does not own or
259+
//! borrow, and no code closes file descriptors it does not own. In other words, a safe function
260+
//! that takes a regular integer, treats it as a file descriptor, and acts on it, is *unsound*.
261261
//!
262262
//! Not upholding I/O safety and acting on a file descriptor without proof of ownership can lead to
263263
//! misbehavior and even Undefined Behavior in code that relies on ownership of its file

0 commit comments

Comments
 (0)