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

Rust analyzer fails to parse windows crate for versions 0.58+ #18962

Open
numonce opened this issue Jan 17, 2025 · 1 comment
Open

Rust analyzer fails to parse windows crate for versions 0.58+ #18962

numonce opened this issue Jan 17, 2025 · 1 comment
Labels
C-bug Category: bug

Comments

@numonce
Copy link

numonce commented Jan 17, 2025

Rust analyzer seems to fail to parse with windows crate from version 58 onwards. Version 57 is parsed fine. This only seems to be a bug when writing on linux to cross compile for windows. The program will still compile, but will error on the cargo check with

error[E0432]: unresolved import `windows::Win32`
 --> src/main.rs:1:5
  |
1 | use windows::Win32;
  |     ^^^^^^^^^^^^^^ no `Win32` in the root

For more information about this error, try `rustc --explain E0432`.

rust-analyzer 1.84.0 (9fc6b43 2025-01-07)

rustc 1.84.0 (9fc6b4312 2025-01-07)

code snippet to reproduce:

use windows::Win32;
fn main() {
    println!("Hello, world!");
}
[dependencies]
windows = { version = "0.59.0", features = ["Win32"] }
@numonce numonce added the C-bug Category: bug label Jan 17, 2025
@numonce numonce changed the title Rust analzer fails to parse windows crate for versions 0.58+ Rust analyzer fails to parse windows crate for versions 0.58+ Jan 17, 2025
@Veykril
Copy link
Member

Veykril commented Jan 18, 2025

How are you telling cargo to build for windows? Via the --target flag? Via .cargo/config?

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

No branches or pull requests

2 participants