Skip to content

Whitespace removed on filling match arms inside tokio::main breaking the code #20119

Open
@SolidTux

Description

@SolidTux

rust-analyzer version: 0.3.2509-standalone

rustc version: 1.87.0

editor or extension: VSCode, extension 0.3.2509

relevant settings:

{
  "rust-analyzer.check.command": "clippy",
  "rust-analyzer.check.extraArgs": ["--all-features"],
  "rust-analyzer.imports.granularity.enforce": true,
  "rust-analyzer.imports.prefix": "crate",
}

code snippet to reproduce:

enum A {
    B,
    C,
}

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let a = A::B;

    match a {
        A::B => {
            let x = 1;
        }
    }

    Ok(())
}

Before:

Image

After:

Image

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