File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ impl AsFd for Stdin {
34
34
impl<'a> AsFd for io::StdinLock<'a> {
35
35
#[inline]
36
36
fn as_fd(&self) -> BorrowedFd<'_> {
37
+ // SAFETY: user code should not close stdin out from under the standard library
37
38
unsafe { BorrowedFd::borrow_raw(0) }
38
39
}
39
40
}
@@ -77,6 +78,7 @@ impl AsFd for Stdout {
77
78
impl<'a> AsFd for io::StdoutLock<'a> {
78
79
#[inline]
79
80
fn as_fd(&self) -> BorrowedFd<'_> {
81
+ // SAFETY: user code should not close stdout out from under the standard library
80
82
unsafe { BorrowedFd::borrow_raw(1) }
81
83
}
82
84
}
@@ -123,6 +125,7 @@ impl AsFd for Stderr {
123
125
impl<'a> AsFd for io::StderrLock<'a> {
124
126
#[inline]
125
127
fn as_fd(&self) -> BorrowedFd<'_> {
128
+ // SAFETY: user code should not close stderr out from under the standard library
126
129
unsafe { BorrowedFd::borrow_raw(2) }
127
130
}
128
131
}
You can’t perform that action at this time.
0 commit comments