Skip to content

Commit 9ce567e

Browse files
committed
Cast libc::STDIN_FILENO to RawFd.
WASI's `RawFd` is a `u32`, while `libc` uses `c_int`.
1 parent 132ec26 commit 9ce567e

File tree

1 file changed

+6
-6
lines changed
  • library/std/src/sys/wasi/ext

1 file changed

+6
-6
lines changed

library/std/src/sys/wasi/ext/io.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,36 +145,36 @@ impl IntoRawFd for fs::File {
145145

146146
impl AsRawFd for io::Stdin {
147147
fn as_raw_fd(&self) -> RawFd {
148-
libc::STDIN_FILENO
148+
libc::STDIN_FILENO as RawFd
149149
}
150150
}
151151

152152
impl AsRawFd for io::Stdout {
153153
fn as_raw_fd(&self) -> RawFd {
154-
libc::STDOUT_FILENO
154+
libc::STDOUT_FILENO as RawFd
155155
}
156156
}
157157

158158
impl AsRawFd for io::Stderr {
159159
fn as_raw_fd(&self) -> RawFd {
160-
libc::STDERR_FILENO
160+
libc::STDERR_FILENO as RawFd
161161
}
162162
}
163163

164164
impl<'a> AsRawFd for io::StdinLock<'a> {
165165
fn as_raw_fd(&self) -> RawFd {
166-
libc::STDIN_FILENO
166+
libc::STDIN_FILENO as RawFd
167167
}
168168
}
169169

170170
impl<'a> AsRawFd for io::StdoutLock<'a> {
171171
fn as_raw_fd(&self) -> RawFd {
172-
libc::STDOUT_FILENO
172+
libc::STDOUT_FILENO as RawFd
173173
}
174174
}
175175

176176
impl<'a> AsRawFd for io::StderrLock<'a> {
177177
fn as_raw_fd(&self) -> RawFd {
178-
libc::STDERR_FILENO
178+
libc::STDERR_FILENO as RawFd
179179
}
180180
}

0 commit comments

Comments
 (0)