-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-crossArea: Cross compilationArea: Cross compilationC-bugCategory: This is a bug.Category: This is a bug.O-hermitOperating System: HermitOperating System: HermitT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
I tried this code:
use std::os::fd::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, RawFd};
With --target x86_64-unknown-hermit
.
I expected to see this happen: code to compile
Instead, this happened: failed to compile with
error[E0432]: unresolved import `std::os::fd`
--> src/net/udp.rs:12:14
|
12 | use std::os::fd::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, RawFd};
| ^^ could not find `fd` in `os`
Looking at the relevant code:
rust/library/std/src/os/mod.rs
Lines 163 to 164 in 212841e
#[cfg(any(unix, target_os = "wasi", doc))] | |
pub mod fd; |
It seems hermit
is imply missed from the cfg
. Inside of the fd
module there is already code for hermit:
rust/library/std/src/os/fd/raw.rs
Lines 18 to 29 in 212841e
#[cfg(target_os = "hermit")] | |
use hermit_abi as libc; | |
/// Raw file descriptors. | |
#[rustc_allowed_through_unstable_modules] | |
#[stable(feature = "rust1", since = "1.0.0")] | |
#[cfg(not(target_os = "hermit"))] | |
pub type RawFd = raw::c_int; | |
#[rustc_allowed_through_unstable_modules] | |
#[stable(feature = "rust1", since = "1.0.0")] | |
#[cfg(target_os = "hermit")] | |
pub type RawFd = i32; |
I think this is just an oversight, but I since I don't develop for Hermit I'm not sure. (I hit this while updating Mio)
/cc @stlankes
Meta
rustc --version --verbose
:
rustc 1.81.0-nightly (f21554f7f 2024-06-08)
binary: rustc
commit-hash: f21554f7f0ff447b803961c51acafde04553c1ed
commit-date: 2024-06-08
host: x86_64-unknown-linux-gnu
release: 1.81.0-nightly
LLVM version: 18.1.7
stlankes
Metadata
Metadata
Assignees
Labels
A-crossArea: Cross compilationArea: Cross compilationC-bugCategory: This is a bug.Category: This is a bug.O-hermitOperating System: HermitOperating System: HermitT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.