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

Add undefined feature diagnostic #11435

Open
jplatte opened this issue Feb 8, 2022 · 4 comments
Open

Add undefined feature diagnostic #11435

jplatte opened this issue Feb 8, 2022 · 4 comments
Labels
A-diagnostics diagnostics / error reporting A-ide general IDE features C-feature Category: feature request S-actionable Someone could pick this issue up and work on it right now

Comments

@jplatte
Copy link
Contributor

jplatte commented Feb 8, 2022

Since this isn't really possible to solve in Clippy, I was wondering whether rust-analyzer could check for existance of a feature or optional dependency named foo in Cargo.toml when encountering cfg(feature = "foo"), and raise a warning if there isn't one.

@lnicola lnicola added A-diagnostics diagnostics / error reporting A-ide general IDE features C-feature Category: feature request S-actionable Someone could pick this issue up and work on it right now labels Feb 8, 2022
@bjorn3
Copy link
Member

bjorn3 commented Feb 8, 2022

There is an accepted rfc for doing this in rustc. It hasn't been implemented yet though: rust-lang/rust#82450

@jplatte
Copy link
Contributor Author

jplatte commented Feb 8, 2022

Oh, awesome! I'll close this then.

@jplatte jplatte closed this as completed Feb 8, 2022
@lnicola
Copy link
Member

lnicola commented Feb 8, 2022

In the long run we might still want to implement this, just as with the other rustc diagnostics.

@jplatte
Copy link
Contributor Author

jplatte commented Feb 8, 2022

Okay, in that case I'll reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics diagnostics / error reporting A-ide general IDE features C-feature Category: feature request S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

No branches or pull requests

3 participants