Skip to content

Conversation

sunfishcode
Copy link
Member

Revisit the safety considerations of rustix::io::stdout and friends. The Rust standard library assumes that the stdin, stdout, and stderr file descriptors are always open, to the point where it's even willing to hand out a 'static borrow for them. Consequently, rustix doesn't need to treat these as unsafe when std is in use.

Revisit the safety considerations of `rustix::io::stdout` and friends.
The Rust standard library assumes that the stdin, stdout, and stderr
file descriptors are always open, to the point where it's even willing
to hand out a [`'static` borrow for them]. Consequently, rustix doesn't
need to treat these as unsafe when std is in use.

[`'static` borrow for them]: https://doc.rust-lang.org/stable/std/io/struct.Stdin.html#method.lock
@sunfishcode sunfishcode merged commit 2a721e2 into main Jan 30, 2023
@sunfishcode sunfishcode deleted the sunfishcode/safe-stdio branch January 30, 2023 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant