ITADN

io::{read,write} cannot be used for std{in,out} on Windows

#1621Openoech3 创建于 2026-05-05
O
oech3commented
`io::{read,write}` is very useful on unix since - `read` accepts uninit array - `write` bypasses `std::io::stdout`'s line buffering However, it cannot be used on windows: ``` error[E0277]: the trait bound `&mut Stdout: AsFd` is not satisfied --> src\uu\tee\src\tee.rs:263:53 | 263 | Self::Stdout(s) => Ok(rustix::io::write(s, buf)?), | ----------------- ^ the trait `AsSocket` is not implemented for `Stdout` | | | required by a bound introduced by this call | = help: the following other types implement trait `AsSocket`: &T &mut T Arc<T> BorrowedFd<'_> Box<T> OwnedFd Rc<T> TcpListener and 5 others = note: required for `&mut Stdout` to implement `AsSocket` = note: required for `&mut Stdout` to implement `AsFd` ```
0 条评论