mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 15:32:06 +00:00
Rollup merge of #77724 - sunfishcode:stdinlock-asrawfd, r=alexcrichton
Implement `AsRawFd` for `StdinLock` etc. on WASI. WASI implements `AsRawFd` for `Stdin`, `Stdout`, and `Stderr`, so implement it for `StdinLock`, `StdoutLock`, and `StderrLock` as well. r? @alexcrichton
This commit is contained in:
commit
ad6e179060
@ -160,3 +160,21 @@ impl AsRawFd for io::Stderr {
|
||||
sys::stdio::Stderr.as_raw_fd()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> AsRawFd for io::StdinLock<'a> {
|
||||
fn as_raw_fd(&self) -> RawFd {
|
||||
sys::stdio::Stdin.as_raw_fd()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> AsRawFd for io::StdoutLock<'a> {
|
||||
fn as_raw_fd(&self) -> RawFd {
|
||||
sys::stdio::Stdout.as_raw_fd()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> AsRawFd for io::StderrLock<'a> {
|
||||
fn as_raw_fd(&self) -> RawFd {
|
||||
sys::stdio::Stderr.as_raw_fd()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user