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

unresolved import for use std::os::unix::net::{UnixListener, UnixStream}; #9459

Closed
gipsyh opened this issue Jul 2, 2021 · 5 comments
Closed

Comments

@gipsyh
Copy link

gipsyh commented Jul 2, 2021

when
use std::os::unix::net::{UnixListener, UnixStream};

it report unresolved import

but cargo actually can compile

@lnicola
Copy link
Member

lnicola commented Jul 2, 2021

CC #6038

This works with nightly, but that has other issues (proc macros not working).

@trindadegm
Copy link

I have this problem on windows now: use std::os::windows::io::RawSocket; was not working. However, after reading #6038, I figured adding cfg-if in the dev-dependencies (or regular dependencies but I don't really need that) would make it work again. Before that I though naively that rust-analyzer was not getting the right target or something and set "rust-analyzer.cargo.target": "x86_64-pc-windows-msvc". I went searching through the github issues after I realized the problem was something else.

I just removed those settings and the cfg-if and the error comes back. Adding just the cfg-if is enough to get it working again.

@PatchMixolydic
Copy link

PatchMixolydic commented Aug 14, 2021

Also happened on nightly Rust Analyzer with rustc 1.53. Fixed by updating to rustc 1.54.
rust-analyzer.serverVersion:

rust-analyzer version: c5ddc35a4 2021-08-14 nightly

rustc -Vv:

rustc 1.53.0 (53cb7b09b 2021-06-17)
binary: rustc
commit-hash: 53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b
commit-date: 2021-06-17
host: x86_64-unknown-linux-gnu
release: 1.53.0
LLVM version: 12.0.1

@sbzi1020
Copy link

I have been used rustc 1.54 and have the same problem, but after I updated to rustc 1.55(the latest version) and it was fixed.

@flodiebold
Copy link
Member

This has been fixed (for some time, I guess).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants