Skip to content

"Run Test" lens should pass --include-ignored instead of --ignored #21889

@SludgePhD

Description

@SludgePhD

rust-analyzer version: 0.3.2836-standalone

rustc version: rustc 1.94.0 (4a4ef493e 2026-03-02)

editor or extension: VS Code

relevant settings:

{
    "rust-analyzer.cargo.cfgs": [
        "debug_assertions",
        "miri",
    ],
}

code snippet to reproduce:

#[test]
#[cfg_attr(miri, ignore)]
fn mytest() {}

Clicking on the "Run Test" lens will execute

cargo test --package hello --bin hello -- mytest --exact --nocapture --ignored

However, the test isn't actually ignored, so nothing will be run. rust-analyzer thinks the test is ignored because the settings enable the "miri" cfg.

While this is arguably my fault (enabling the "miri" cfg in rust-analyzer isn't really required or helpful), if rust-analyzer unconditionally passed --include-ignored instead of --ignored, the entire logic for conditionally injecting --ignored could be removed and this use case would Just Work™.

--include-ignored has been stable for half a decade, so there shouldn't be a problem with using it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-idegeneral IDE featuresC-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