You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Essentially, if a module file is cfg gated with #![cfg(windows)] or any OS that you're not currently targeting, rust-analyzer incorrectly marks the whole parent file as greyed out with the inactive code warning instead of just marking the module as greyed out. It also marks the module that should be inactive as not greyed out, but with no type completions.
This code does compile with rustc and runs as expected. It seemed to repro with both release and pre-release versions.
Pictured RA version: v0.4.2064 (pre-release)
Rust version: 1.80
The text was updated successfully, but these errors were encountered:
It does seem like you can not hit this issue if you instead use #[cfg(windows)] where the module is defined, instead of #![cfg(windows)] at the top of the module file. It seems like somehow #![cfg(windows)] is getting propagated to the parent instead of the local module?
I have a minimal repro of this issue here: https://github.com/chris-oo/ra-inactive-code-repro
Essentially, if a module file is cfg gated with
#![cfg(windows)]
or any OS that you're not currently targeting, rust-analyzer incorrectly marks the whole parent file as greyed out with the inactive code warning instead of just marking the module as greyed out. It also marks the module that should be inactive as not greyed out, but with no type completions.This code does compile with rustc and runs as expected. It seemed to repro with both release and pre-release versions.
Pictured RA version: v0.4.2064 (pre-release)
Rust version: 1.80
The text was updated successfully, but these errors were encountered: