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

Feature Request: Detect no_std per-crate and ignore check.allTargets #14205

Open
DianaNites opened this issue Feb 25, 2023 · 1 comment
Open
Labels
A-cargo cargo related issues A-flycheck issues with flycheck a.k.a. "check on save" A-no_std issues related to no_std handling C-feature Category: feature request

Comments

@DianaNites
Copy link
Contributor

DianaNites commented Feb 25, 2023

If possible, the option for RA to detect that a crate* is no_std and disable check.allTargets, to seamlessly prevent issues like #2142 once and for all, where you can either have RA checking tests where it makes sense, or you can stop bogus errors in no_std crates, but not both.

*specifically, in my case, I have a VSCode workspace with various cargo crates/workspaces, some no_std, some not, with per-folder .cargo/config.toml setting targets.

Alternatively, another option would be do detect no_std and use a new option, checkOnSave.extraNoStdArgs, for something like as a (manual) solution. Or both?

{
    "rust-analyzer.checkOnSave.allTargets": false,
	"rust-analyzer.checkOnSave.extraArgs": [
        "--all-targets"
    ]
    "rust-analyzer.checkOnSave.extraNoStdArgs": [
        "--bins"
    ]
}
@DianaNites DianaNites added the C-feature Category: feature request label Feb 25, 2023
@Veykril Veykril added the A-cargo cargo related issues label May 26, 2023
@Veykril
Copy link
Member

Veykril commented May 26, 2023

Doing this for flycheck (that is cargo check) is kind of tricky right now, as we built the command before we even analyze crates. We'd have to feed back this info after having analyzed all crates which we only do lazily ... So we probably want to change flycheck do built the command on demand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cargo cargo related issues A-flycheck issues with flycheck a.k.a. "check on save" A-no_std issues related to no_std handling C-feature Category: feature request
Projects
None yet
Development

No branches or pull requests

2 participants