Skip to content

proc-macro panicked: rstest is present in Cargo.toml qed: Invalid toml file. rust-analyzer (macro-error) #22553

@eirnym

Description

@eirnym

I observe an error proc-macro panicked: rstest is present in Cargo.toml qed: Invalid toml file. rust-analyzer (macro-error) with conditions below:

I have multiple test modules which heavily using rstest and tokio::test. It's happening in any module within any function either it sync or async, either it contain no cases (just rstest used) or thousands (per single test function).

At the moment, when I open such module, I see [rstest] marked in red with message in subject and text below as details.

When I put cursor at the end of this lines and hit space once, this test become shown as resolved and I see types and colors.

cargo build --tests, cargo nextest list/run working fine.

Problem is not persistent, starts after few hours of work and "self-resolves" with a RA full restart. Around a month back I have no such issue at all. Few opened projects help to reproduce an issue. My code base is only 146 files and overall test count is only about 5000. I run tests and cargo often from CLI, and never from UI.

rstest_macros
proc_macro rstest

rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P) rust-analyzer version: 0.3.2896-standalone (e266f5cab8 2026-05-10)

rustc version: (eg. output of rustc -V): rustc 1.94.1 (e408947bf 2026-03-25)

editor or extension: (eg. VSCode, Vim, Emacs, etc. For VSCode users, specify your extension version; for users of other editors, provide the distribution if applicable) VSCodium Wersja: 1.121.03429

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)

repository link (if public, optional): (eg. rust-analyzer) Repository is not public at the moment.

code snippet to reproduce:

// add your code here
use rstest::rstest;

#[rstest]
fn test() {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions