Skip to content

Diagnostics don't identify cfg condition on use std::os::fd::OwnedFd; #115185

Description

@joshtriplett

Code

use std::os::fd::OwnedFd;

fn main() {}

Current output

/tmp/my-portable-project$ cargo +nightly build --target x86_64-pc-windows-gnu
   Compiling my-portable-project v0.1.0 (/tmp/my-portable-project)
error[E0432]: unresolved import `std::os::fd`
 --> src/main.rs:1:14
  |
1 | use std::os::fd::OwnedFd;
  |              ^^ could not find `fd` in `os`

For more information about this error, try `rustc --explain E0432`.
error: could not compile `my-portable-project` (bin "my-portable-project") due to previous error

Desired output

The output should include the additional information from #109005 identifying the relevant cfg, effectively telling the user that this only exists on unix or wasi, not windows.

Rationale and extra context

No response

Other cases

No response

Anything else?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions