Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
joshtriplett opened this issue Aug 24, 2023 · 1 comment · Fixed by #122766
Closed

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

joshtriplett opened this issue Aug 24, 2023 · 1 comment · Fixed by #122766
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-resolve Area: Name resolution T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@joshtriplett
Copy link
Member

joshtriplett commented Aug 24, 2023

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

@joshtriplett joshtriplett added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 24, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 24, 2023
@joshtriplett
Copy link
Member Author

cc @Nilstrieb

@Noratrieb Noratrieb added A-resolve Area: Name resolution and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Aug 24, 2023
@bors bors closed this as completed in 03f5c4f Mar 26, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Mar 26, 2024
Rollup merge of rust-lang#122766 - bvanjoi:fix-115185, r=petrochenkov

store segment and module in `UnresolvedImportError`

Fixes rust-lang#115185

An easy fix. r? `@Nilstrieb`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-resolve Area: Name resolution T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants