Skip to content

RA shows warnings in autogenerated files inside target directory when using alternative target location #12685

Open
@martin-t

Description

@martin-t

rust-analyzer version: 0.0.0 (cc0bb71 2022-07-02)

rustc version: rustc 1.64.0-nightly (46b8c23f3 2022-07-01)

relevant settings:

{
    "rust-analyzer.server.extraEnv": {
        "CARGO_TARGET_DIR": "target-ra"
    },
    "rust-analyzer.checkOnSave.command": "clippy"
}

I use target-ra as a separate target directory for RA in VSCode. My project uses lalrpop which puts generated files in this target directory. RA shows warnings in one of these autogenerated files (target-ra/debug/build/fml-738faf2a1534b33c/out/fml.rs). I think this is a bug because it doesn't show warnings if using the normal shared target directory and in general it makes no sense to show warns in files i can't do anything about.

It can be reproduced on this repo on the ra-bug branch. It contains a .vscode config that should contain everything needed - the warnings should be visible as soon as RA finishes analyzing the project:

Screenshot_20220704_013110

Interestingly, there are other target-ra/debug/build/fml-*/out/fml.rs files but it only happens with this particular one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions