Skip to content

Rust-Analyzer Hangs and Fails to Display Errors with Local Proc-macro-Crate Dependency #17786

Closed
@SchlexanderOlz

Description

@SchlexanderOlz

rust-analyzer version: 0.3.2020-standalone

rustc version: 1.80.0 (051478957 2024-07-21)

editor or extension: VSCode rust-analyzer v0.3.2020

relevant settings:

repository link (if public, optional):

code snippet to reproduce:

Issue Description:
When adding a local crate dependency in the Cargo.toml the rust-analyzer enters an endless loop without any error output. Code completion still works, but no errors are displayed. The issue does not occur with no local dependency. I have tried removing the local dependency and calling cargo clean, which fixes the issue, but I obviously now can't use that local library I need.

Before this issue I have faced a similar one by updating to the latest rust-analyzer version. I tried to fix the issue as described in #17765 and #17744 but none of the approaches worked. I then tried downgrading the analyzer version to 0.3.2020 which is where I am currently at.

Cargo.toml of the main crate:

[package]
name = "monitoring-data"
version = "0.1.0"
edition = "2021"

[dependencies]
redisadapter_derive = { path = "../redisadapter_derive" }
redis = { version = "0.25.4" }
tracing = "0.1.40"

[features]
default = ["redis"]
redis = []

Cargo.toml of the derive-macro crate:

[package]
name = "redisadapter_derive"
version = "0.1.5"
edition = "2021"

[lib]
proc-macro = true

[dependencies]
syn = "1.0"
quote = "1.0"
proc-macro2 = "1.0.86"
lazy_static = "1.5.0"

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions